I'm trying to automate a script that runs to enable system restore upon startup (yes, every time my PC boots). I found this PowerShell script that seems to work when entered directly into a PowerShell terminal window.
Enable-ComputerRestore -Drive "C:"
But I want to turn it into a script file to run by placing in the Startup folder. I've tried entering this script into notepad, saving as "All Files" as a ".ps1" and then set that file extension to open with PowerShell as the default app. But it loads a red error that quickly vanishes as the terminal window closes.
I usually place .bat files in the startup to launch programs, and I understand this can be done to launch a .ps1 file, but right now the .ps1 doesn't even work when launched by PowerShell that I set as its default app.
Is there an easier way to automate Enabling system restore silently preferably through a .bat script?