Last time we saw how to get our Internet Explorer settings out of the registry. And in PowerShell, for nearly every 'Get', there's an equivalent usage for 'Set'.
Here's how it works. Suppose we wanted to change, say, the Start Page for Internet Explorer. First, let's get the current setting (We'll use variables to minimize typing):
$path = 'HKCU:\Software\Microsoft\Internet Explorer\Main\'
$name = 'start page'
(Get-ItemProperty -Path $path -Name $name).$name
As we can see, the IE start page is currently set to msn.com
So where there's a get, there's a set:
$value = 'https://www.google.com/'
Set-ItemProperty -Path $path -Name $name -Value $value
Now we've set IE's start page to google.com. We can test this by running the Get-ItemProperty command again to get the setting, or simply launch IE and see what comes up.
No comments:
Post a Comment