问题标签 [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.
powershell - 如何让“pwsh -c {...}”在Ubuntu上通过powershell命令的表达式结果?
在我的 Ubuntu 16 服务器上的 PHP 脚本中,我希望能够检查 Powershell 是否安装了某个模块,我尝试通过以下方式进行操作
但是即使模块没有安装,这一行也会返回 1。我想这是因为pwsh
返回true
独立于 powershell 命令的结果,表示该命令正确执行。有没有办法让我pwsh
通过结果?
powershell - 为什么 Get-CimInstance CIM_LogicalDisk 返回两种类型?
为什么Get-CimInstance CIM_LogicalDisk
同时返回 aWin32_LogicalDisk
和 a Win32_MappedLogicalDisk
?
有一个 Win32_MappedLogical 磁盘 CIM 类,但没有 Cim_MappedLogicalDisk` 类。应该有吗?
在 pwsh 6 中似乎也没有。Linux 上的 pwsh 6 中没有 CIM cmdlet。CIM 是 Microsoft 独有的吗?我以为不是。
powershell - 删除 HTML 中的区域
我想在 HTML 中删除一个自我强加的区域。我已经制定了正确的正则表达式,我已经在Expresso中证明了这一点,并且正确的部分被突出显示。
我在多行模式下运行它,并将此设置设置为 PowerShell 正则表达式字符串
遗憾的是,尽管该文件已被触及,但该区域并未被删除。
powershell - Powershell 'x 或 y' 赋值
有几种语言提供默认或逻辑或分配机制:
到目前为止,我在 Powershell Core 中发现的唯一等价物是非常冗长的:
在某些情况下必须成为
有没有更好的选择 [edit:] 不会牺牲可读性?
macos - “Install-Module -name AzureAD”在使用 MacOSX 的 PS6 上失败并出现错误
我能够在 MacOSX 上安装 Powershell Core,现在我正尝试从该实例管理 Azure AD 实例。
安装 AzureAD 模块时,出现以下错误
我四处寻找在 Mac 上安装 api-ms-win-core-sysinfo 的方法,但由于它是不同的操作系统,我没有看到任何直接的解决方案。
powershell - Can I customise the 'not recognized as the name of a cmdlet' error in Powershell?
Say I make a typo on the command line:
Powershell returns:
The long message is useful for scripts, but for interactive shell use, I'd like to wrap it with something shorter, like:
Can I wrap the error and change it to something shorter?
powershell-core - 多部分表单脚本在 PowerShell 中完美运行,但在 PowerShell 核心中无法运行
以下代码在 Windows Server 上的 PowerShell 中完美运行
但是当我在 Mac 上的 PowerShell 核心中运行时,我收到以下错误:
知道这里有什么问题吗?非常感谢提前。
comobject - 使用 PowerShell Core for Mac 加载带有宏的 .xls 文件
我正在尝试使用 PowerShell Core for Mac 加载 Excel 文件,但遇到New-Object
. 它在第一行就失败了
这是我收到的错误消息:
有没有人遇到过这个问题,有人知道如何解决吗?