为什么 PowerShell ISE 不允许我在以管理员身份运行时设置断点? [英] Why won't PowerShell ISE let me set breakpoints when running as Administrator?
问题描述
无法让 PowerGUI 正常工作 我已经依赖 PowerShell ISE.但是,如果我以管理员身份运行它,它不会让我设置任何断点.
Having failed to get PowerGUI to work properly I've fallen back on PowerShell ISE. However if I run this as Administrator it won't let me set any breakpoints.
如果我正常启动(我的登录名是管理员的成员),一切都很好,但是因为我需要编写一些需要完全管理员权限的任务,所以这是不好的.
If I launch as normal (my login is a member of Administrators) all is well but because I need to script some tasks that require full administrator rights this is no good.
我已经将脚本保存为一个正确的文件(即它不是untitled1.ps1")但没有任何乐趣.
I have saved the script as a proper file (i.e. it's not "untitled1.ps1") but no joy.
我运行的是 Windows 7 x64 Ultimate.
I'm running Windows 7 x64 Ultimate.
奇怪的是,这在我的 Windows 2008 R2 开发设备上似乎不是问题(我以作为管理员成员的用户身份登录,然后以管理员身份"运行 PS ISE 并设置并命中断点.
Strangely this doesn't seem to be a problem on my Windows 2008 R2 dev box (I'm logging in as user that is a member of Administrators then running PS ISE "As Administrator" and breakpoints are set and hit.
知道为什么会这样吗?
推荐答案
PowerShell 和文件夹和文件名中的方括号似乎有问题.
It looks like there's a problem with PowerShell and square brackets in folder and filenames.
如果被调试的脚本位于名称中带有 [
或 ]
的文件夹中,PowerGUI 和 PowerShell ISE 都不会命中断点.
Both PowerGUI and PowerShell ISE won't hit breakpoint if the script being debugged resides in a folder with [
or ]
in the name.
这篇关于为什么 PowerShell ISE 不允许我在以管理员身份运行时设置断点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!