positional parameters powershell code example
Example 1: parameter powershell
Param (
[Parameter(Mandatory=$True, Position=1)]
[string]$String,
[Parameter(Mandatory=$True)]
[int]$Int,
[switch]$Switch = $false
)
Example 2: how to parse command value in powershell
powershell -Command "(gc $env:userprofile\.android\avd\Nexus_4_API_23.avd\config.ini) -replace 'vm.heapSize=%getRam%','%setRam%' | Out-File -encoding ASCII $env:userprofile\.android\avd\Nexus_4_API_23.avd\config.ini"