But that's pretty language specific to Java
This has nothing to do with Java. This is how developers working on the project decided to do that. Also what you are asking about Powershell has nothing specific to the Powershell. There is no difference in the approach, if you use it for Java, of for Powershell, of for anything else.
There are different approaches. One of them is following. Configuration files in the repository refer some files with predefined locations. For instance:
- Files with fixed names in the user home directory or some of its subdirectories. Every developer creates such a file in his home directory and puts needed credentials there.
- Files in a directory that is defined via environment variable. Every developer creates a directory where he wants, defines path to it via environment variable defined in the script, like
ABC_HOME=C:\..., then puts files with credentials in that directory.
User home directory is known at any time via environment variable USER_HOME. Thus you can build the path to your file. To Powershell: Depending how complex is your script, credentials can be put to a properties file (then you need to load them as such) or can be put to another script file (then you need just to call it from your script).
With such approach you can have not only credentials common for the whole team, but also credentials specific to every developer.
Such approach is good for cross-platform applications, when some developers use Windows, some use Linux, some use Mac. In case o Powershell you may want to use Windows specific tools like Windows Credential Manager. Here there are some examples how can one use it. This tool is a matter of taste. Some developers consider as advantage that there is a GUI. The other find it as disadvantage because it is implicit and because it cannot be easily searched, copied or edited.
Thus, what approach you prefer is a matter of taste.