Get-Content [-ReadCount <Int64>] [-TotalCount <Int64>] [-Tail <Int32>] [-Path] <String[]> [-Filter <String>] [-Include <String[]>] [-Exclude <String[]>] [-Force] [-Credential <PSCredential>] [-Delimiter <String>] [-Wait] [-Raw] [-Encoding <Encoding>] [-As...
23.Get-PSDrive:获取当前会话中的 Windows PowerShell 驱动器 24.Get-Item:获取位于指定位置的项 25.Get-Process :获取在本地计算机或远程计算机上运行的进程 26.Get-Service : 获取本地或远程计算机上的服务 27.Get-Transaction :获取当前(活动)事务 28.Get-ExecutionPolicy :获取当前会话中的执行策略 二.Set类 ...
17.Get-EventLog : 获取本地或远程计算机上的事件日志或事件日志列表中的事件 18.Get-ChildItem : 获取一个或多个指定位置中的项和子项 19.Get-Content : 获取指定位置的项的内容 20.Get-ItemProperty :获取指定项的属性 21.Get-WmiObject : 获取 Windows Management Instrumentation (WMI) 类的实例或可用类的...
Stop-Service-DisplayName(Get-Content-Path$env:TEMP\services.txt) 此概念类似于代数中的运算顺序。 就像先计算括号中的数学运算一样,在外部命令之前执行括在括号中的命令。 PowerShellGet PowerShellGet(PowerShell 5.0 及更高版本随附的模块)提供用于发现、安装、更新和发布 NuGet 存储库中的 PowerShell 模块和...
-match, -imatch, -cmatch - string matches regex pattern -notmatch, -inotmatch, -cnotmatch - string doesn't match regex pattern Replacement -replace, -ireplace, -creplace - replaces strings matching a regex pattern Containment -contains, -icontains, -ccontains - collection contains a value...
使用PowerShellGet模块中的Install-Modulecmdlet。 PowerShell Install-ModulexPSDesiredStateConfiguration PowerShellGet模块会将该模块下载到: C:\Program Files\Windows PowerShell\Modules 规划任务 你是否有权访问 Windows Server 2012 R2 的安装文件? 部署环境是否可以访问 Internet 以便从联机库下载 WMF 和模块?
When you run the function, the value you supply for a parameter is assigned to a variable that contains the parameter name. The value of that variable can be used in the function. The following example is a function called Get-SmallFiles. This function has a $Size parameter. The function ...
}functionF_GetRegPropertyValue{param( [Parameter(Mandatory=$true)][String]$Key, [Parameter(Mandatory=$true)][String]$Name, [Parameter(Mandatory=$true)][String]$Operator, [Parameter(Mandatory=$true)]$DefaultValue, [Parameter(Mandatory=$true)][String]$Msg)try{$Value=Get-ItemPropertyValue-Path"Reg...
Set-Content[-Path] <string[]> [-Value] <Object[]> [-PassThru] [-Filter <string>] [-Include <string[]>] [-Exclude <string[]>] [-Force] [-Credential <pscredential>] [-WhatIf] [-Confirm] [<CommonParameters>] PowerShell Set-Content[-Value] <Object[]>-LiteralPath<string[]> [-Pa...
type, cat, gc 基于文本行来读取内容 Get-Content gi 获取指定的文件或者目录 Get-Item gp 获取文件或目录的属性 Get-ItemProperty ii 使用对应的默认windows程序运行文件或者目录 Invoke-Item — 连接两个路径为一个路径 Join-Path mi, mv, move 移动文件或者目录 Move-Item ni 创建新文件或者目录 New-Item ri...