powershell - PowerShell如何解散

标签 powershell

我知道如何使用splatting将参数传递给cmdlet。

我如何将cmdlet写入“unsplat”?我想将所有参数作为哈希表传递给我的函数。

例如:

function Test-Unsplat
{
    [cmdletbinding()]

    param(
        $ParamA,
        $ParamB
    )

    # WHAT TO DO HERE TO GET @{ParamA = '...', ParamB = '...'}
}

最佳答案

我找到了答案

Get-Help about_Splatting

我一直在寻找的答案是$ PSBoundParameters。

关于powershell - PowerShell如何解散,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29568541/

相关文章:

PowerShell FTP 上传

powershell - 为什么 Fake/F# 通配在 UNC 路径上不起作用

powershell - 通过多个标签查找azure资源?

powershell - 从命令行查看与 "Local Area Connection"Status gui 相同的统计信息

windows - Chef - Powershell 输出

windows - Windows-从命令行为事件创建任务

powershell - 在Powershell中使用前缀批量重命名多个文件

powershell - 如何使用 PowerShell 从 'Applications and Services Logs' 读取分析 Windows 事件?

powershell - 使用 Powershell 在 msi 中设置摘要信息

powershell - 使用 Get-Help cmdlet 以相同格式显示基于注释的帮助