I have the following code in Powershell
$filePath = \"C:\\my\\programming\\Powershell\\output.test.txt\" try { $wStream = new-object IO.FileStream $file
Another way would be to use just the name of the value and let PowerShell cast it to the target type:
New-Object IO.FileStream $filePath ,'Append','Write','Read'