I am attempting to create and access a Volume Shadow Copy snapshot using the Windows Power Shell in Windows 7. I found that I can create snapshots using the following via a
How did you create the symlink? As outlined in that article, you have to specify the device path with a trailing backslash:
$s1 = (Get-WmiObject -List Win32_ShadowCopy).Create("C:\", "ClientAccessible")
$s2 = Get-WmiObject Win32_ShadowCopy | Where-Object { $_.ID -eq $s1.ShadowID }
$d = $s2.DeviceObject + "\" # <-- this here
cmd /c mklink /d C:\shadowcopy "$d"
After this, I was able to access the shadow copy mounted to C:\shadowcopy
just fine.
To unmount the shadow copy call $s2.Delete()
, as @KeyszerS pointed out in the comments.