[GELÖST] run_powershell
Veröffentlicht: 28. April 2020 - 11:40 Uhr
Guten Morgen,
Ich kann kein PowerShell-Skript ausführen.
Ich habe mit dem Befehl get-executionpolicy überprüft, ob ich mich im RemoteSigned- oder im Unrestricted-Modus befinde
Um das Problem besser debuggen zu können, habe ich einfach ein "ls" in meine test.ps1-Datei eingefügt, und ich habe immer noch dasselbe Problem.
Kein Problem, wenn ich den Befehl einfach ausführe mit
Ich habe es auch versucht
Habe ich etwas verpasst?
Hier ist die Konsolenausgabe, die ich erhalte:
Ich kann kein PowerShell-Skript ausführen.
Ich habe mit dem Befehl get-executionpolicy überprüft, ob ich mich im RemoteSigned- oder im Unrestricted-Modus befinde
Um das Problem besser debuggen zu können, habe ich einfach ein "ls" in meine test.ps1-Datei eingefügt, und ich habe immer noch dasselbe Problem.
Kein Problem, wenn ich den Befehl einfach ausführe mit
Code: Alle auswählen
run_powershell('ls')Code: Alle auswählen
run_powershell('test.ps1')
run_powershell_from_file('test.ps1')Hier ist die Konsolenausgabe, die ich erhalte:
Code: Alle auswählen
2020-04-28 11:33:30,980 CRITICAL Fatal error in install script: CalledProcessErrorOutput: Command u'$ProgressPreference = "SilentlyContinue"\n(test.ps1) | ConvertTo-Json' returned non-zero exit status 1.
Output:#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><S S="Error">test.ps1 : Le terme ®test.ps1¯ n'est pas reconnu comme nom d'applet de commande, fonction, fichier de script ou _x000D__x000A_</S><S S="Error">programme ex‚cutable. V‚rifiez l'orthographe du nom, ou si un chemin d'accŠs existe, v‚rifiez que le chemin d'accŠs _x000D__x000A_</S><S S="Error">est correct et r‚essayez._x000D__x000A_</S><S S="Error">Au caractŠre Ligne:2 : 2_x000D__x000A_</S><S S="Error">+ (test.ps1) | ConvertTo-Json_x000D__x000A_</S><S S="Error">+ ~~~~~~~~_x000D__x000A_</S><S S="Error"> + CategoryInfo : ObjectNotFound: (test.ps1:String) [], CommandNotFoundException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : CommandNotFoundException_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S></Objs>:
Traceback (most recent call last):
File "C:\Program Files (x86)\wapt\common.py", line 3823, in install_wapt
exitstatus = setup.install()
File "c:\waptdev\fl-bat-cmd-wapt\setup.py", line 10, in install
run_powershell('test.ps1')
File "C:\Program Files (x86)\wapt\setuphelpers_windows.py", line 933, in run_powershell
raise CalledProcessErrorOutput(e.returncode,cmd,e.output)
CalledProcessErrorOutput: Command u'$ProgressPreference = "SilentlyContinue"\n(test.ps1) | ConvertTo-Json' returned non-zero exit status 1.
Output:#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><S S="Error">test.ps1 : Le terme \xabtest.ps1\xbb n'est pas reconnu comme nom d'applet de commande, fonction, fichier de script ou _x000D__x000A_</S><S S="Error">programme ex\xe9cutable. V\xe9rifiez l'orthographe du nom, ou si un chemin d'acc\xe8s existe, v\xe9rifiez que le chemin d'acc\xe8s _x000D__x000A_</S><S S="Error">est correct et r\xe9essayez._x000D__x000A_</S><S S="Error">Au caract\xe8re Ligne:2 : 2_x000D__x000A_</S><S S="Error">+ (test.ps1) | ConvertTo-Json_x000D__x000A_</S><S S="Error">+ ~~~~~~~~_x000D__x000A_</S><S S="Error"> + CategoryInfo : ObjectNotFound: (test.ps1:String) [], CommandNotFoundException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : CommandNotFoundException_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S></Objs>
FATAL ERROR : CalledProcessErrorOutput: Command u'$ProgressPreference = "SilentlyContinue"\n(test.ps1) | ConvertTo-Json' returned non-zero exit status 1.
Output:#< CLIXML
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><S S="Error">test.ps1 : Le terme ®test.ps1¯ n'est pas reconnu comme nom d'applet de commande, fonction, fichier de script ou _x000D__x000A_</S><S S="Error">programme ex‚cutable. V‚rifiez l'orthographe du nom, ou si un chemin d'accŠs existe, v‚rifiez que le chemin d'accŠs _x000D__x000A_</S><S S="Error">est correct et r‚essayez._x000D__x000A_</S><S S="Error">Au caractŠre Ligne:2 : 2_x000D__x000A_</S><S S="Error">+ (test.ps1) | ConvertTo-Json_x000D__x000A_</S><S S="Error">+ ~~~~~~~~_x000D__x000A_</S><S S="Error"> + CategoryInfo : ObjectNotFound: (test.ps1:String) [], CommandNotFoundException_x000D__x000A_</S><S S="Error"> + FullyQualifiedErrorId : CommandNotFoundException_x000D__x000A_</S><S S="Error"> _x000D__x000A_</S></Objs>
Exit code: 3
>>>