Excel VBA et PowerShell

Bonjour,

Sur Excel, j'ai un Code VBA qui vient ping une liste d'adresses IP grâce a un script PowerShell.

Ca fonctionne bien, mais ça m'ouvre une fenêtre PowerShell à chaque ping.

Comment éviter cela?

Fichier joint

le fichier txt doit être renommé en ps1

Cdt

Bonjour Samcro49,

Je te propose d'ajouter la clause -NoExit dans ta commande Powershell :

        ' Construire la commande PowerShell GVS
        strCommand = "powershell.exe -ExecutionPolicy Bypass -NoExit -File """ & strScriptPath & """ -IPAddress """ & strIPAddress & """ -Port """ & strPort & """"

        ' Exécuter la commande PowerShell en arrière-plan
        objShell.Run strCommand
Rechercher des sujets similaires à "vba powershell"