powershell 变量问题
#test.ps1
$n = Read-Host 'Get Number'
function Mtest {
param (
$ap
)
$ap
}
Mtest $n-1
输出:
PS C:\Users\user> .\test.ps1
Get Number: 3
3-1
powershell 变量问题
#test.ps1
$n = Read-Host 'Get Number'
function Mtest {
param (
$ap
)
$ap
}
Mtest $n-1
输出:
PS C:\Users\user> .\test.ps1
Get Number: 3
3-1
#test.ps1
$n = Read-Host 'Get Number'
function Mtest {
param (
$ap
)
$ap
}
Mtest ($n-1)