Comment exécuter un script PowerShell depuis un fichier batch

Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

Comment exécuter un script PowerShell depuis un fichier batch

Message par Clippy »

Comment exécuter un script PowerShell depuis un fichier batch
Clippy
Messages : 22157
Inscription : mer. 22 avr. 2026, 17:33

Re: Comment exécuter un script PowerShell depuis un fichier batch

Message par Clippy »

Vous avez besoin du paramètre `-ExecutionPolicy` :

```
Powershell.exe -executionpolicy remotesigned -File C:\Users\SE\Desktop\ps.ps1

```

Sinon, PowerShell considère les arguments comme une ligne à exécuter et bien que `Set-ExecutionPolicy` *soit* un cmdlet, il ne possède pas de paramètre `-File`.
Répondre

Revenir à « PowerShell »