I am relatively new to PowerShell, just trying to practice automation scripts that would be useful our company. In essence, I want to disable IPv6 if it is enabled, else if it is disabled, do nothing. Either way, it should return a result through Write-Host. I’m not sure where I’m going wrong here. I may have over analyzed this
Thanks @Olaf ! I had to modify the script slightly to a directory that already existed: c:\temp, but it worked. Still learning to use Get-Help and all the goodies it has in store.
I did notice that the folder was not created in Public from Export-Csv. When I changed it to an existing directory it worked fine. Any idea why that is?
To me it always feels a kind of unprofessional to save something to a temp directory if it’s not actually temporary.
I updated my code suggestion with the check if the directory exists and if it does not create it. If we do it we try to do it right at the first time.
And of course you could have just used the folder C:\Users\Public as it always exists on Windows computers. And you could even use the environment variable to specify it $env:PUBLIC.
Metablaster, I would be interested in hearing the reasons why disabling IPV6 is a bad idea. I have used NETSH to do this many times with no issues that I am aware of.
Most important reason is that MS does OS testing with IPv6 enabled, this means if you disable it there is no quarantee that things will work by design.
The worst thing that may happen is when you need to troubleshoot problems with IPv6 disabled.
Windows is designed with IPv6 in mind, not without.
I don’t know if you ever heard of “nasal demons”, but things can get close to that when troubleshooting networking.
I had a good link about IPv6 but site is no longer online unfortuantelly.
It’s the same with UAC… so many people I know got in the habit of disabling it that it’s hard to get them to consider why they still do. I haven’t seen a legitimate issue caused my UAC in years. Now IPv6 I have seen issues resolved by disabling it recently. There is usually a better, alternate solution.