问题标签 [powershell-ise]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
powershell - 告诉 PowerShell ISE 不要将 stderr 发送到 Write-Error
当可执行文件写入标准错误流 ( stderr
) 时,PowerShell 控制台和 PowerShell ISE 的行为不同。控制台 (powershell.exe) 将其显示为标准输出。例如,当我在非存储库上获得 Mercurial 状态时,它会写入标准错误:
但是,在 PowerShell ISE ( powershell_ise.exe
) 中,该错误会传递给 PowerShell 的Write-Error
cmdlet:
有没有办法将 ISE 配置为像控制台一样运行,而不是将 stderr 流发送到Write-Error
?
powershell-3.0 - 如何在 powershell 版本 3 中调用 Microsoft.PowerShell.GraphicalHost
我当前的 ps 版本是 v3,但是如果我需要调用程序集“Microsoft.PowerShell.GraphicalHost”,则此程序集是我已安装的 Windows Management Framework Core 的一部分,但仍然出现以下错误 Add-Type : Could not加载文件或程序集 'Microsoft.PowerShell.GraphicalHost, Version=1.0 .0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 或其依赖项之一。该系统找不到指定的文件。任何大师可以帮助我?
powershell - 使用 Powershell V3 安装 PowerGUI 后无法使用 out-gridview
只是想知道是否有人看到这个并且知道解决方法。
我正在运行 Windows 7 64 位,刚刚升级到 Powershell V3。从那以后,我不能使用 out-gridview 命令。我收到以下错误。
要使用 Out-GridView cmdlet,请从服务器管理器安装 Windows PowerShell 集成脚本环境功能。(无法加载文件或程序集 'Microsoft.PowerShell.GraphicalHost, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 或其依赖项之一。系统找不到指定的文件。)
我已经打开了本机 MS ISE,并且可以运行 out-gridview 而不会出现错误。
powershell - 如何在内部加载带有 powershell v2 的 Powershell ISE 3?
我刚刚在我的 Windows 7 机器上安装了新的 powershell 3,然后我发现新版本的 powershell 不适用于 Sharepoint 2010。
我还找到了解决此问题的方法(此处或此处)。但它只解决了标准 powershell 控制台的问题。由于我们通过 ISE 完成大部分工作,我想知道是否可以在 ISE 中做同样的事情?
我尝试添加版本参数,但 ISE 不知道。我尝试在powershell -version 2
ISE 的控制台中输入,但没有帮助。
如果不可能,我还有一个问题:我需要将 ISE 与 Sharepoint 2010 一起使用,那么如何卸载 powershell 3 和新的 ISE?
powershell-remoting - Remote Tab in ISE Connects to a powershell 1.0 session
I have PowerShell v3 installed and launch the ISE from my local workstation. When I open a remote tab to a server(win2K8R2 WMF 3 installed) I seem to get a powerShell V1 session. I checked this by inspecting the $host variable.
This server has WMF 3.0 installed and when I open either the ISE or a PowerShell prompt locally from the server, I get a v3 session.
Other machines do not display this behavior and do run powershell v3 when opened locally or via a remote tab
I'm at a loss to troubleshoot this behavior. I want the remote tab to open a v3 Session.
Any Thoughts?
powershell - 目录/文本搜索时的 DISTINCT Select-String 输出
我很好奇如何根据这个例子生成一个不同的文件列表。
** 此示例生成所有 .ps1 和 .psm1 文件的列表,其中包含文本“文件夹”,但在同一行中没有文本“.invoke”。
这很酷并且效果很好,但是我得到了重复的文件输出(相同的文件但不同的行号)。
如何保持我的文件输出不同?
当前不受欢迎的输出:
- C:\Workspace\mydirectorytosearch1\anonymize-psake.ps1:4:。"$($folders.example.test)\anonymize\Example.vars.ps1"
- C:\Workspace\mydirectorytosearch1\anonymize-psake.ps1:5:。"$($folders.missles)\extract\build-utilities.ps1"
所需的输出:
- C:\Workspace\mydirectorytosearch1\anonymize-psake.ps1
帮我调整我的脚本??
.net - 为什么我的 Write-Verbose 消息没有出现?
我已将一些评论替换为:
我通过 PS ISE 运行我的脚本,例如:
但是在输出窗口中,我看不到任何这些消息。
如何显示 write-Verbose 消息?
.net-4.0 - 使用 CurrentDomain.SetData("APP_CONFIG_FILE") 在 PowerShell ISE 中不起作用
我正在尝试在 PowerShell ISE 中使用 .NET 4.0 程序集,并尝试更改通过以下方式使用的配置文件:
[Configuration.ConfigurationManager]::ConnectionStrings.Count 总是返回“1”,
而“[Configuration.ConfigurationManager]::ConnectionStrings[0].Name”总是返回“LocalSqlServer”,并且那个 ConnectionString 名称不在我的“.config”中文件。
请注意,从 PowerShell 命令提示符执行 PowerShell 脚本会按预期运行。只是当我从 PowerShell ISE 中执行它时,它没有按预期工作。
powershell-ise - 如何映射 Ctrl+Shift+S 以在 PowerShell ISE 中保存所有文件
我已经习惯按Ctrl++Shift将S所有文件保存在 Visual Studio 中。PowerShell ISE 无法识别此组合键,并让我的文件处于编辑状态而不保存它们。
这意味着对我的脚本所做的更改不会被保存,我的脚本也不起作用。
有什么方法可以将Save All键绑定添加到 PowerShell ISE?
debugging - Set-DefaultScaffolder:调试 T4Scaffolding.Core Nuget 包时无法获取 EnvDTE.DTE 的实例 - 高级 Powershell 调试
我正在尝试从 Visual Studio 2012 外部调试 T4Scaffolding.Core Nuget 包。我正在使用安装了 Powershell 3.0 的 Powershell ISE,并在 CLRVersion 4.0.30319 下运行。
我首先导入几个 Nuget 相关项: - Profile.ps1 - nuget.psm1 - NuGet.Cmdlets.dll
我还将当前位置设置为 set-location "\ClassLibrary1\" 并获得了当前运行的唯一 DTE 实例(我之前在 VS 2012 中打开了 MySolution,其中有一个类库和一个 asp.net MVC 4 应用程序)
我跳过了从 NuGet.Cmdlets.dll 二进制模块导入 Get-Project cmdlet,因此我可以创建自己的 cmdlet:Get-Project 以这种方式获取我的 MVC 项目:
我可以进入 init.ps1: \packages\T4Scaffolding.Core.1.0.0\tools\init.ps1 但代码在执行时失败:
我还尝试指向我的 $project 名称(省略 -SolutionWide),结果相同:
我可以观察到 EnvDTE.dll 通过使用以下方法加载到 Powershell ISE 环境中:
希望有人会对实现相同的目标感兴趣(逐行通过 Visual Studio 外部 Nuget 包的 init.ps1 和 install.ps1)。
谢谢,拉德