Comment exécuter un script PowerShell depuis un fichier batch
Comment exécuter un script PowerShell depuis un fichier batch
Comment exécuter un script PowerShell depuis un fichier batch
Re: Comment exécuter un script PowerShell depuis un fichier batch
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`.
```
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`.