【发布时间】:2020-01-13 03:36:54
【问题描述】:
我在 Onedrive for Business 路径中有一个 ps1 文件。在命令下运行时,它出错了,但运行速度如此之快,我无法获得错误截图。 如果我将脚本放在另一个本地驱动器路径中,它可以正常工作。 Onedrive 中有什么预防措施?
Start-Process powershell.exe -ArgumentList $ps1path
ps文件内容
$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"
【问题讨论】:
-
当您在powershell中运行命令时,执行后powershell窗口是否关闭?什么跑得这么快?
-
我不知道它运行的是哪个脚本。我在脚本末尾暂停了。
-
我试过 Set-ExecutionPolicy -ExecutionPolicy bypass ,还是不行。
标签: powershell onedrive