Just a quick example of how to pass parameters to a powershell function. This works also as script parameters…
#——————–
function test{
Param($inOptional1=”Hi”,$inRequired1=$(throw “inRequired1 is a required input”),$inOptional2=$null)
Write-Host $inOptional1
Write-Host $inRequired1
Write-Host $inOptional2
}
“——————-”
test “Hello” “World” “Lovely day”
“——————-”
test -inOptional1 “Hello” -inRequired1 “World”
“——————-”
test -inOptional1 “Hello” -inRequired1 “World” -inOptional2 “Lovely day”
“——————-”
test -inRequired1 “World”
“——————-”
test -inOptional1 “Hello”
“——————-“
Shalom Andrew,
I need to open from jscript SCCM – which I succeed.
My problem is that I need the SCCM to open to connection mode and fill in a parameter.
meanwhile I succeeded copying to the clipboard the text.
So the user needs to press file->connect and press ctrl+V.
is there a way to send parameters on opening the SCCM (jscript opens with “location /app-v version” ) and it will open the file-> connect and put the parameter for connection?
Thanks a lot,
AJ
Instead of SCCM It’s remote Configuration Manager 2007 Remote Access.
Sorry for confusing. If I understood correctly it’s a program added through the SCCM.
Hi AJ, do you mean rc.exe? I do have a custom version of this somewhere and I’ll dig it out in the new year.
One thing to mention about rc.exe is that when used standalone it does not log to sccm log files like it does when accessed from the console. The audit trail from the console can be pretty useful and if you don’t use it like that then it only logs to eventvwr on the remote machine which is pretty useless…
Try this:
http://technet.microsoft.com/en-us/library/bb681027.aspx
Works! Thank you!