Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kevinblumenfeld/ebfcf9bd0a1bde3dc8d67f56e703c482 to your computer and use it in GitHub Desktop.
Save kevinblumenfeld/ebfcf9bd0a1bde3dc8d67f56e703c482 to your computer and use it in GitHub Desktop.
PS D:\scripts> $computers | % {$session = New-PSSession $_ ; invoke-command -scriptblock {Send-File -Source "D:\scripts\Generate_FilePath\OfficeProPlu
s.msi" -Destination "C:\scripts\R\OfficeProPlus.msi" -Session $session}}
PS D:\scripts> $computers | % {$session = New-PSSession $_ ; invoke-command -AsJob -scriptblock {Send-File -Source "D:\scripts\Generate_FilePath\Offi
ceProPlus.msi" -Destination "C:\scripts\R\OfficeProPlus.msi" -Session $session}}
Invoke-Command : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:47
+ ... ession $_ ; invoke-command -AsJob -scriptblock {Send-File -Source "D ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Invoke-Command], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.InvokeCommandCommand
Invoke-Command : Parameter set cannot be resolved using the specified named parameters.
At line:1 char:47
+ ... ession $_ ; invoke-command -AsJob -scriptblock {Send-File -Source "D ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Invoke-Command], ParameterBindingException
+ FullyQualifiedErrorId : AmbiguousParameterSet,Microsoft.PowerShell.Commands.InvokeCommandCommand
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment