'Get-PnPFile file hash convert cannot convert the "Microsoft.SharePoint.Client.File" value of type "Microsoft.SharePoint.Client.File" to type
Any ideas how to get the file hash of a OneDrive (SP) file? I really can't stand SP would be nice to do with PnP
$res = (Get-PnPFile -URL "/Documents/Au-Crouchy.xlsx").OpenBinaryStream()
Invoke-PnPQuery
$stream = Add-PnpFile -FileName $a -Folder "TargetLib" -Stream $res.Value
Get-FileHash -InputStream $stream | select-object hash
I tried other options for getting the file hash. Error received is:
Get-FileHash : Cannot process argument transformation on parameter 'InputStream'. Cannot convert the "Microsoft.SharePoint.Client.File" value of type "Microsoft.SharePoint.Client.File" to type "System.IO.Stream".
Thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
