Trying to write a simple PowerShell script, but got stuck with an error, and I can't find any solution on the web.
$stream = [IO.MemoryStream]::new([Text.Encoding]::UTF8.GetBytes('aaaaaaaaaa!'))
Get-FileHash -InputStream $stream -Algorithm SHA512
AddPnPFile -Path './bundle.json' -Folder "$($FolderRelativeURLGeneral)$($folder)" -Stream $stream
Why am I getting an error for providing a stream to the Stream parameter? Removing the parameter solved the issue, but obviously I want to write something to the file, so can someone tell me how to write content to the file? Do I need to create a filestream out of the stream? However, the documentation doesn't specify that it has to be a file stream. How come it doesn't work?