PowerShell series (eight) PowerShell system default built-in Provider introduction

Previous review
of PowerShell series (1): The difference between PowerShell introduction and cmd command line

PowerShell Series (2): Introduction to the Differences Between PowerShell and Python

PowerShell series (3): Combing the development history of PowerShell

PowerShell Series (4): Three ways for PowerShell to enter the interactive environment

PowerShell Series (5): PowerShell runs notes through scripts

PowerShell Series (6): PowerShell Script Execution Strategies

PowerShell Series (7) Introduction to Provider in PowerShell

PowerShell is a command-line interface for operating systems that is cross-platform and provides many features to automate and optimize various tasks. PowerShell is officially developed by Microsoft and shipped as part of the Windows Server operating system. Using PowerShell, you can perform many operational operations such as creating, editing, viewing, and deleting files and folders, managing users and computers, configuring network settings, running system commands, automating testing and deployment, and more. Today I will continue to share with you the PowerShell series of tutorials.

The previous article explained the relevant knowledge of Provider in PowerShell. Today, I will introduce the relevant knowledge of Provider built into the PPowerShell system by default.

Table of contents

1. Alias ​​Provider

2. Certificate Certificate Provider

3. Environment variable Environment Provider

Fourth, the file system FileSystem Provider

Five, function function Function Provider

6. Registry Provider

7. Variable Variable Provider 

8. Web service management WM-Man Provider


 

Today, I will explain to you the default built-in Provider of the PowerShell system. I hope it can be helpful to you!

Excuting an order 

Get-PSDrive

1. Alias ​​Provider

Alias ​​Provider is used to mark objects of other commands. It is generally used to mark longer functions or commands in commands. It also supports specifying aliases of commands in CMD Shell in PowerShell. In fact, the purpose is to simplify the use of some commands through shorter aliases.

The command is as follows:

 #进入别名provider
 cd alias:
 # 查询可用的别名
 get-childItem

 

# 获取别名的个数,操作系统版本不同可能会有差异
get-childItem |measure  

 

2. Certificate Certificate Provider

Certificate Certificate is a Provider for certificate operations (certificate storage, addition, and deletion).

# 进入证书cert
d cert:
# 获取证书Provider的用户和计算机证书存储节点
get-childitem

3. Environment variable Environment Provider

Environment variables are different types of system environment variables of the current operating system, such as operating system name, temporary directory, Java environment variable, operating system version, and so on.

The command is as follows:

# 进入环境变量provider
cd env:
# 查询当前系统的环境变量列表
get-childitem

Fourth, the file system FileSystem Provider

The file system is the most frequently used Provider, and all operations related to files are inseparable from the FileSystem Provider object. The PowerShell window enters the FileSystem Provider by default. For operation and maintenance engineers, it is used almost every day, but everyone has not noticed it.

#进入E盘
cd E:
#查看E盘文件列表
get-childitem

 

Five, function function Function Provider

The function function refers to the function function in the current PowerShell. It is a set of functions that perform a specific task. There is no secondary directory function. The function set can be understood as being in the same directory.

The command is as follows:

#进入功能函数Provider
cd function:
#获取可用的功能函数列表
get-childitem 

Note: The currently obtained functions can be directly executed in the PowerShell environment.

6. Registry Provider

Registry Provider is responsible for managing the registry, enabling applications to access and modify information in the registry. Through the Registry Provider, the application can easily access the key-value data in the registry, and can customize the name, value, description and other attributes of the key-value object. Registry Provider also provides some methods, so that the application can load the data in the registry in advance, so that the application can use these data when it starts

There are two ways to enter the registry

HKLM: Get the registry of the current computer

cd hklm:
get-childitem

Description: Get-childitem will be prompted : The requested registry access is not allowed.

HKCU: get current user registry

cd hkcu:
get-childitem

7. Variable Variable Provider 

Variable Provider mainly obtains the values ​​of variables in the current operating system (excluding system variable information), and also includes PowerShell preference configuration and variables created by the current Session.

Order:

cd variable:
get-childitem

Explanation: The Provider of variables has only one level.

8. Web service management WM-Man Provider

Web service management is the web service management interface of the current operating system. Early operating systems used WMI for data acquisition, using port 135 in the RPC protocol for data acquisition. In order to avoid the risk of obtaining data on port 135, Microsoft officially re-launched WS -Man, the way of connecting to the host is used for server management, which not only solves the security problem, but also reduces the difficulty of server management.

cd wsman:
get-childitem

Guess you like

Origin blog.csdn.net/xishining/article/details/131434134