Tips for Writing Cross-Platform PowerShell Code
I just spent a month updating one of our PowerShell modules to support Linux and MacOS. I learned a lot that I wanted to share with the community as cross-platform support becomes more and more important. Use “Environment” Class Properties Instead of “env:” Drive Environment variables are different between the different operating systems. All of them have PATH , but not much else. Windows and MacOS both have variables for the temp directory, but they have different names.