I have a ps1 file in Onedrive for Business path. when running below command, it gets something wrong, but it runs so fast, I can't get the error screenshots. If I put the script in another local drive path, it works fine. Any prevention in Onedrive?
Start-Process powershell.exe -ArgumentList $ps1path
ps file content
$current_path = Split-Path -Parent $MyInvocation.MyCommand.Definition
$up1_path = Split-Path -Parent $current_path
$up2_path = Split-Path -Parent $up1_path
$up1_path
$up2_path
cmd /c "pause"
It's not Onedrive case. Just the start-process can't accept a space in ArgumentList.
$pspath = $pspath -replace ' ','` '
Start-Process powershell.exe -ArgumentList $pspath