Recettes PowerShell
De Linuxmemo.
(Différences entre les versions)
Ligne 1 : | Ligne 1 : | ||
- | [PowerShell] | + | [[Catégorie:PowerShell]] |
==exécuter une commande stocké dans une variable== | ==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