Reputation: 121
I need to include the following powershell script in my .yml file:
[byte[]] $projectFile = [System.IO.File]::ReadAllBytes($ProjectFilePath)
How to fix the error?
Upvotes: 0
Views: 785
Reputation: 39708
[
is a special character in YAML and starts a flow sequence. If you want that character at the beginning of a scalar, value, quote the value:
"[byte[]] $projectFile = [System.IO.File]::ReadAllBytes($ProjectFilePath)"
Alternatively, use a literal block scalar:
key: |-
[byte[]] $projectFile = [System.IO.File]::ReadAllBytes($ProjectFilePath)
Upvotes: 3