格式字串

$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 方法一起使用。