Invoke-PSUScript clarification

Invoke-PSUScript clarification

avatar

Can anyone please clarify the difference between Invoke-PSUScript -Name and Invoke-PSUScript -Script? -Name says it’s “The name of the script to invoke.” and -Script says it’s “The script to invoke. Use Get-PSUScript to retrieve existing scripts.”, and if you use either, the other command is no longer available to use (i.e., they cancel each other out, like one is maybe a deprecated form of the other).

All Comments (4)

avatar

Good question. I have always used the following

$ScriptParams = [ordered]@{
    Name         = 'ActiveDirectory\Edit-User.ps1'
}
Invoke-PSUScript @ScriptParams


avatar

And I’ve been using -Script. I wasn’t even aware of -Name until yesterday.

avatar

So same but different. Still the same, though.

6922cd00669ca08576d43ef291694b3221be39a2

6922cd00669ca08576d43ef291694b3221be39a2.gif

avatar

I feel like we’ve entered The Twilight Zone. Adam is Rod Serling.