Re: VSS?

[email protected] (ToddAndMargo via perl6-users) Fri, 13 Jun 2025 13:12:28 -0700
Newsgroups perl.perl6.users
Message-ID <[email protected]>
On 6/12/25 6:27 AM, ToddAndMargo via perl6-users wrote:
> Hi All,
> 
> Is there any Raku support for Windows VSS (Volume
> Shadow Copy)?
> 
> Many thanks,
> -T
> 

I looking to make a shadow copy of a directory or directories,
copy from it/them, then remove the shadow.

Best I could find is calls to powershell.  Be nice
if Raku had support for this.  Other languages do,
so I thought Raku might as well.

The best I could find was answer #2 using powershell.
I suppose I could make call to powershell.

https://superuser.com/questions/1895377/create-a-non-persistent-shadow-copy-for-backups-on-windows-11-pro

# set drive letter
$DriveLetter = 'C'

# create shadow copy of volume
$shadow = Invoke-CimMethod -MethodName Create -ClassName 
Win32_ShadowCopy -Arguments @{Volume="$($driveletter):\\"}

# get path to browse snapshot
$shadowCopy = Get-CimInstance -ClassName Win32_ShadowCopy | where {$_.ID 
-eq $shadow.ShadowID}
$shadowMount = 'c:\temp\shadow'

# create a link to access the snapshot with
cmd /c mklink /d 'c:\temp\shadow' "$($ShadowCopy.DeviceObject)\"

# example: copy some file out of snapshot to back it up
Copy-Item "$shadowMount\temp\test.txt" -Destination 'c:\temp\restored.txt'

# delete the shadow copy when finished
$shadowCopy | Remove-CimInstance


-T