I have the following code in Powershell
$filePath = \"C:\\my\\programming\\Powershell\\output.test.txt\" try { $wStream = new-object IO.FileStream $file
Yet another way could be to enclose the enums in parens:
$wStream = new-object IO.FileStream $filePath, ([System.IO.FileMode]::Append), ` ([IO.FileAccess]::Write), ([IO.FileShare]::Read)