Powershell zweites Script mit Parameter in relativem Pfad starten
Hallo ,
Ich habe ein Powershell Script, welches unter D: liegt.
Dieses soll ein weiteres Script starten, welches unter D:\utils\update\Powershell liegt un die variable $var1 mitgeben
Ich habe folgendes versucht:
Das gibt nur den gesamten Pfad aus:
.
und
Ich habe ein Powershell Script, welches unter D: liegt.
Dieses soll ein weiteres Script starten, welches unter D:\utils\update\Powershell liegt un die variable $var1 mitgeben
Ich habe folgendes versucht:
$PSScriptRoot+"utils\update\Powershell\update.ps1 $var1"
Das gibt nur den gesamten Pfad aus:
D:\utils\update\Powershell\update.ps1 4.5.123.3
und
Start-Process -Filepath $PSScriptRoot+"utils\update\Powershell\update.ps1 "+$var1
Start-Process : This command cannot be run due to the error: The system cannot find the file specified.
At D:\Untitled2.ps1:2 char:1
+ Start-Process -Filepath $PSScriptRoot+"utils\update\Powershell\update.ps1 ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException
+ FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
Please also mark the comments that contributed to the solution of the article
Content-Key: 72901046737
Url: https://administrator.de/contentid/72901046737
Printed on: June 11, 2024 at 15:06 o'clock
7 Comments
Latest comment