Making Easy To Handle PowerShell Command Line Arguments

Asked By 0 points N/A Posted on -
qa-featured

What is the finest method to handle Power Shell command line arguments? How to handle the command line arguments in the Power Shell in a better way?

SHARE
Answered By 10 points N/A #119180

Making Easy To Handle PowerShell Command Line Arguments

qa-featured

There are various methods to handle the command line arguments in the Power Shell prompt. I have mentioned a few of the commands below:

script.ps2 /n name /d domain

Or

script.ps2 /d domain /n name.

Default values can also be assigned to the parameters by writing the subsequent code in the Power Shell: param (

[String] $Name Of Server= "http://default server",

[Parameter (Mandatory=$true)] [String] $Name Of User,

[String]$code = $(Read-Host "Set the password")

)

Related Questions