格式字符串

$hash = @{ city = 'Berlin' }

$result = 'You should really visit {0}' -f $hash.city
Write-Host $result #prints "You should really visit Berlin"

格式字符串可以与 -f 运算符或静态 [String]::Format(string format, args) .NET 方法一起使用。