- Powershell Core 6.2 Cookbook
- Jan Hendrik Peters
- 160字
- 2021-06-24 15:14:26
How it works...
Depending on your operating system, there'll be the following providers:
- Alias: Allowing access to aliases
- Environment: Allowing access to environmental variables
- Function: Allowing access to function script blocks
- Variable: Allowing access to variables
- FileSystem: Allowing access to the filesystem and the mounting of CIFS shares
- Certificate: Currently Windows-only, allowing access to certificate stores
- Registry: Windows-only, allowing access to the Windows registry
- WSMan: Currently Windows-only, allowing access to WinRM configuration via WSMan
This is a non-exhaustive list, as new providers are added through modules or can be created with the module SHiPS, which we'll see in the recipe, Create your own provider.
The provider code implements different cmdlets such as Get-ChildItem and uses its own logic in the code to do what the cmdlet name implies. Not all providers implement all operations. While it's perfectly fine to use New-Item in the filesystem, it'll work differently with the certificate provider, which only allows creating new certificate stores.