Recettes PowerShell
De Linuxmemo.
(Différences entre les versions)
(→exécuter une commande stocké dans une variable) |
|||
Ligne 1 : | Ligne 1 : | ||
[[Catégorie:PowerShell]] | [[Catégorie:PowerShell]] | ||
- | == | + | ==Exécuter une commande stocké dans une variable== |
Invoke-Command -ComputerName $Ip -Credential $login -ScriptBlock { Param( $LocalVariable ); Invoke-Expression -Command $LocalVariable } -ArgumentList $commande | Invoke-Command -ComputerName $Ip -Credential $login -ScriptBlock { Param( $LocalVariable ); Invoke-Expression -Command $LocalVariable } -ArgumentList $commande |
Version du 4 avril 2018 à 08:35
Exécuter une commande stocké dans une variable
Invoke-Command -ComputerName $Ip -Credential $login -ScriptBlock { Param( $LocalVariable ); Invoke-Expression -Command $LocalVariable } -ArgumentList $commande