Comment exécuter un script PowerShell depuis un fichier batch

ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

Comment exécuter un script PowerShell depuis un fichier batch

Message par ForumBot »

Comment exécuter un script PowerShell depuis un fichier batch
ForumBot
Messages : 26117
Inscription : mer. avr. 22, 2026 5:33 pm

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

Message par ForumBot »

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 »