PSProviders

PowerShell has some things called PSProviders.

PSProviders are .NET programs that allow easy access to data stores such as the file system, registry, certificate stores and the environment amongst other things. You can access these using a fairly traditional file system approach.

Sometimes technology specific cmdlets are more intuitive, on other occasions using this approach can be very helpful. The author has on several occasions found support for the registry PSProvider incredibly useful to search, add and amend registry entries using default PowerShell syntax and being able to easily create, amend and delete files is always a bonus, particularly when logging the activity of more complex scripts.

Microsoft provides a list of default providers on their MS Docs about_providers page.

ProviderDrive(s)
AliasAlias:
CertificateCert:
EnvironmentEnv:
FileSystemC: (*)
FunctionFunction:
RegistryHKLM: HKCU:
VariableVariable:
WSManWSMan:
Table of default PSProviders taken from MS Docs page

cmdlets

You are likely familiar with the file system cmdlets already, things such as

  • Get-ChildItem
  • Get-Content
  • Add-Content
  • New-Item
  • Remove-Item

Microsoft provide a full list on the about_providers docs page and these can all be used with PSProviders, so adding and removing files, creating and amending registry keys, and reading and writing environment variables are all done using a simple file system approach.

Help

You can use the Get-PSProvider to get information on which providers are installed on your system and you can of course use our old friend Get-Help Get-PSProvider to get further information.

If you need specific information on a particular provider you can use Get-Help for that also just type the provider name, for example Get-Help Registry, you will see the ouput in the same fashion as any other cmdlet.

Let’s look at how we might use these in more detail in the next section.

References

about_us – Microsoft Docs