I need to calculate a hash on a vmdk file (around 50GB), I want to do this using PowerCLI, and In a remote way (the remote thing is critical).
The remote vmdk file is in the datastore (ESXi host)
I tried to map the disk the following way:
1. connect to the Vcenter using :
Connect-VIServer
2. declared my variable:
$ssds = Get-Datastore -Name "CCT_VMs_22"
$dataStoreForSnapshots = "z"
3. and mapped the path:
New-PSDrive -Location $ssDs -Name $dataStoreForSnapshots -PSProvider VimDatastore -Root "" -Scope "Local"
4.Then from the path of the vmdk location I tried:
Get-FileHash <filepath> -Algorithm MD5
filepath: z:\ELK-Win8x64_tmp\ELK-Win8x64_tmp.vmdk
and get the follwing error:
Test-Path : File [CCT_VMs_22] server@443/ILHZ-Lab/CCT_VMs_22/ELK-Win8x64_tmp/ was not found
At
C:\windows\system32\windowspowershell\v1.0\Modules\Microsoft.PowerShell.Utility\Microsoft.PowerShell.Utility.psm1:80
char:20
+ ... if(Test-Path -LiteralPath $filePath -PathType Container)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Test-Path], FileNotFound
+ FullyQualifiedErrorId : VMware.VimAutomation.ViCore.Types.V1.ErrorHandling.FileNotFound,Microsoft.PowerShell.Com
mands.TestPathCommand
Get-FileHash : The file
'\server@443\ILHZ-Lab\CCT_VMs_22\ELK-Win8x64_tmp\ELK-Win8x64_tmp.vmdk' cannot be read: Could
not find a part of the path
'C:\server@443\ILHZ-Lab\CCT_VMs_22\ELK-Win8x64_tmp\ELK-Win8x64_tmp.vmdk'.
At line:1 char:1
+ Get-FileHash z:\ELK-Win8x64_tmp\ELK-Win8x64_tmp.vmdk -Algorithm MD5
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ReadError: (\server...in8x64_tmp.vmdk:PSObject) [Write-Error], WriteErrorExcepti
on
+ FullyQualifiedErrorId : FileReadError,Get-FileHash
any ideas how to get the following done?