How do you access System Properties in a Powershell Script?

I've been working on setting up a build with the Powershell runner for the first time and am having troubles getting access to System Properties in my build script. I've tried using $variable syntax and have tried printing out all the variables in session, but I do not see any TeamCity properties available. I also could not find any documentation for this specific question.

Can somebody please tell if it is possible to do and an example of how to do it?

2 comments
Comment actions Permalink

No answers yet, so I'll give an update. The answer seems to be that System Properties are not supported or understood in Powershell but Environment Variables are. Environment Variables can be accessed using the "env" provider, eg., $env:VariableName.

0
Comment actions Permalink

System properties are accessed through the registry, in my experience. I was able to script remote desktop settings using the registry. If not, there is usually an associated script for other things like Power settings.

0

Please sign in to leave a comment.