TIMTOWTDI has been the catch cry of Perl hackers for as long as I’ve been familiar with the language and the interpreter. With PowerShell being an interactive shell first and foremost it is obvious that it would offer the same services.
Today I was reading a PowerShell mailing list and one of the posters asked how to permanently modify the PATH environment variable. I thought for a moment then jumped into action. My feeble attempt is attached.
I then looked back at the other responses which had come in, and there was this little gem attached:
[Environment]::SetEnvironmentVariable(“Path”, “$Env:Path;C:\Directory”, “Machine”)
I should have known this since I am a .NET developer, but I automatically jumped into Cmdlet/Provider space. There is definitely more than one way to do it with PowerShell J