4
Q:

powershell parameter

Param (
	[Parameter(Mandatory=$True, Position=1)]
	[string]$String,
    
    [Parameter(Mandatory=$True)]
    [int]$Int,
    
    [switch]$Switch = $false
)
1
 param (
    [string]$server = "http://defaultserver",
    [Parameter(Mandatory=$true)][string]$username,
    [string]$password = $( Read-Host "Input password, please" )
 )
0
write-host "There are a total of $($args.count) arguments"
for ( $i = 0; $i -lt $args.count; $i++ ) {
    write-host "Argument  $i is $($args[$i])"
} 
0
function Print-Text {
    param(
      	[String] $Text
    )
    
    Write-Output $Text
}

Print-Text "Hello, world!"
-1

New to Communities?

Join the community