PSMinifier
PSMinifier copied to clipboard
Function parameters are stripped if defined without "param" keyword
function testfunc($str1, $str2)
{
'calling testfunc'
$str1
$str2
}
function testfunc2 {
Param([string]$str1, [string]$str2)
'calling testfunc2'
$str1
$str2
}
testfunc 'foo' 'bar'
testfunc2 'foo' 'bar'
Output:
calling testfunc
foo
bar
calling testfunc2
foo
bar
After PSMinifier:
function testfunc{'calling testfunc';$str1;$str2};function testfunc2{param([string]$str1,[string]$str2)'calling testfunc2';$str1;$str2};testfunc 'foo' 'bar';testfunc2 'foo' 'bar'
Output:
calling testfunc
calling testfunc2
foo
bar