I’m trying to create a task to turn on system protection for drive C and set the disk space usage to 3%
this is what I got for now:
1.folder create "C:\vss"
2.createfile until end
3.Enable-ComputerRestore -Drive "C:"
4.net start vss
5.vssadmin resize shadowstorage /for=C: /on=C: /maxsize=3%
8.move __createfile "C:\vss\vss.ps1"
9.waithidden powershell.exe -executionpolicy bypass -file "C:\vss\vss.ps1"
10.folder delete “C:\vss”
this task finishes as complete
At the end, line 3 works perfectly , line 5 doesn’t work at all max storage size doesn’t get changed
Any Ideas of how to create this task differently?
thank you in advance