Recettes PowerShell

De Linuxmemo.

(Différences entre les versions)
(exécuter une commande stocké dans une variable)
Ligne 1 : Ligne 1 :
-
[[PowerShell]]
+
[PowerShell]
-
[[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:34

[PowerShell]

exécuter une commande stocké dans une variable

Invoke-Command -ComputerName $Ip -Credential $login -ScriptBlock { Param( $LocalVariable ); Invoke-Expression -Command $LocalVariable } -ArgumentList $commande
Outils personnels