问题标签 [powershell-core]

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.

0 投票
2 回答
1447 浏览

macos - 如何从 PowerShell 脚本打开另一个 PowerShell 控制台

在 OSX 中,我打开一个 bash 终端并进入一个 PowerShell 控制台。在我的 PowerShell 脚本中,我想打开另一个 PowerShell 控制台并在那里执行一个 PowerShell 脚本。

在 Windows 下,我会做

我怎么能在 OSX 中做同样的事情?

0 投票
0 回答
176 浏览

oracle - 如何在 OSX 上通过 Powershell 直接与 Oracle 的 Instant Client 交互?

我编写了一个PowerShell 模块来与 Oracle 数据库交互,其方式Invoke-SqlCmd与 SQL Server 的交互方式相同。

我希望能够在 OS X 上使用这个模块,现在 Window 的PowerShell可用。

在 Windows 中,System.Data.OracleClient程序集提供 Oracle 调用。虽然有Mono 版本,但似乎支持 OS TODOX。

有没有办法通过 PowerShell 直接与 Oracle 的Instant Client交互并避免组装问题?

0 投票
0 回答
291 浏览

windows - 在 Windows 和 Mac 中复制目录的命令相同

我想要相同的命令来复制 Windows 和 Mac 中的目录。我不想cp在 Mac 的终端和xcopyWindows 的 PowerShell 中使用两个不同的命令。是否有一个命令可以在 Mac 和 Windows 中使用而无需任何更改?

0 投票
2 回答
666 浏览

macos - Mac错误上的Powershell脚本

刚刚下载 powershell 尝试在 Mac 上运行脚本并收到以下错误。非常感谢任何熟悉非 Windows 用户的人的帮助。:)

0 投票
3 回答
3344 浏览

powershell - PowerShell 6 - 支持 Windows GUI 库

我了解新的 PowerShell 6/core 缺乏对 Windows GUI 库的支持,我使用Windows.Forms .NET 类在 PS-5.1 中开发了一些重要项目。

问题: 我们计划在今年夏天升级到 PowerShell 6,这意味着我将失去所有的 GUI 功能(使用 Windows.Forms 开发)。

问题: 在这种情况下我们应该怎么做才能在我们的 PS 应用程序中保留 GUI 功能。您是否设想 Microsoft 会为未来的 GUI 支持提供任何替代方案?

TIA

0 投票
1 回答
731 浏览

macos - 如何在 MacOS 上安装 powershell

我已经安装了 powershell PKG 文件,我可以从应用程序启动 powershell在此处输入图像描述

但是,我想将它集成到 Mac 上的终端中。

根据此链接,安装 pkg 文件后,我应该能够powershell在终端上运行命令并切换到 PS 模式。

0 投票
13 回答
23565 浏览

powershell - 如何删除 Powershell 开始文本?

Powershell 6 具有 Unix 风格/etc/issue,其中提到了文档的链接。

这很好,但是:

  • 我知道文档在哪里
  • 我知道我启动了 Powershell 6

如何删除部分或全部消息?IIRC Powershell 5 仍然有版权信息,所以也许我不能删除它,但去掉最后 3 行会有帮助吗?

0 投票
1 回答
313 浏览

linux - 自定义提示在 Ubuntu 上的 PowerShell Core 6.0 中打印两次

我的 $PROFILE 中有一个自定义 PowerShell 提示功能,它在 Windows 上适用于 PS 5.1 和 PS Core 6.0,但不适用于 Ubuntu 17.04 上的 PS Core 6.0。

在 Ubuntu 提示符上重复: 重复提示

为了让事情变得更有趣,当我开始输入时,光标移动并且命令文本出现在我期望的位置,如果输出没有重复: 光标在预期位置 命令还将在重复的提示输出之上打印输出。

输出$PSVersionTable

生成提示的函数:

我是 Linux 的新手,我对可能导致这种奇怪行为的原因的搜索到目前为止都没有结果。任何帮助,将不胜感激。

0 投票
8 回答
29765 浏览

visual-studio-code - Toggle between fullscreen editor and terminal in VS Code

As a Windows systems admin, I use PowerShell quite a lot. With the release of PS Core, and the implication that the ISE is dead, I've started to try to use VS Code as my day to day tool. One feature I'm missing from ISE is the ability to swap between the editor and the terminal in fullscreen. I usually kept ISE open and maximized, and used Ctrl+R to swap between editor and terminal as needed. I haven't found a way to maximize the terminal, and swap easily between terminal and editor. I know I can make the terminal take up most of the screen, but a) this still leaves about 2 lines of editor open at the top, and b) there doesn't seem to be an easy way to then maximize the editor. Is there a way to minic the ISE behaviour that I haven't found yet?

0 投票
1 回答
6954 浏览

linux - 如何从 powershell 获取主机名?

如何从 powershell获取主机名dur

系统的 FQDN 实际上是dur.bounceme.net,这将是首选输出。