Forum Discussion
desert_lizard
Sep 27, 2024Copper Contributor
shadowcopy
I see when I type wmic /? it shows me wmi options for shadowcopy. Thats great if using the deprecated WMI tool. Leads me to, so I can pull shadowcopy information using WMI tool, what about PS? ...
Alikoc
Oct 16, 2024MCT
Hi,
To work with shadowcopy in PowerShell, you can utilize WMI (Windows Management Instrumentation) classes through PowerShell. Specifically, the Win32_ShadowCopy WMI class provides access to shadowcopy-related operations.
1. List Shadow Copies:
Get-WmiObject -Class Win32_ShadowCopy
2. Create a Shadow Copy:
(Get-WmiObject -List Win32_ShadowCopy).Create("C:\", "ClientAccessible")
3. Delete a Shadow Copy:
(Get-WmiObject -Class Win32_ShadowCopy | Where-Object { $_.ID -eq 'shadowcopyID' }).Delete()