小编Mar*_*yah的帖子

PowerShell 中的“@{}”是什么意思

我在这里有一行脚本供审查,我注意到带有值的变量声明:

function readConfig {
    Param([string]$fileName)
    $config = @{}
    Get-Content $fileName | Where-Object {
        $_ -like '*=*'
    } | ForEach-Object {
        $key, $value = $_ -split '\s*=\s*', 2
        $config[$key] = $value
    }
    return $config
}
Run Code Online (Sandbox Code Playgroud)

我想知道@{}in是什么意思$config = @{}

powershell powershell-4.0

4
推荐指数
1
解决办法
5818
查看次数

标签 统计

powershell ×1

powershell-4.0 ×1