I'm a total noob on windows powershell. How can I use psl to call SHGetKnownFolderPath ? I want to then also call SHSetKnownFolderPath if I dont like some of the values back from Get call.
You can use P/Invoke. Lee Holmes has an example of how to do this from PowerShell here. There's an example of how to use SHGetKnownFolderPoath
here.
Alternatively, you might just be able to use Environment.GetFolderPath
:
PS> [Environment]::GetFolderPath('CommonApplicationData')
C:\ProgramData
You can get the list of available options by the following:
PS> [Enum]::GetNames([Environment+SpecialFolder])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With