Get-Command Get-ExperimentalFeature Get-Help Get-History Get-Job Get-Module Get-PSHostProcessInfo Get-PSSession Get-PSSessionCapability Get-PSSessionConfiguration Get-PSSubsystem Import-Module Invoke-Command In
Set-ExecutionPolicy-ExecutionPolicyRemoteSigned-ScopeCurrentUser 将执行策略设置为RemoteSigned后,Get-TimeService.ps1脚本将成功运行。 PowerShell .\Get-TimeService.ps1 Output Status Name DisplayName --- --- --- Running W32Time Windows Time 总结 在本章中,你...
Also, you might need to run multiple iterations of the command with the ReadFromDomainController switch to get the information. By default, the recipient scope is set to the domain that hosts your Exchange servers. Expand table Type: SwitchParameter Position: Named Default value: None Required:...
pause this command and receive a prompt for credentials, use the value(Get-Credential). Or, before you run this command, store the credentials in a variable (for example,$cred = Get-Credential) and then use the variable name ($cred) for this parameter. For more information, seeGet-...
如以下示例所示,可以使用Get-CommandParameterName参数来标识包含ComputerName参数的 cmdlet。 PowerShell Get-Command-ParameterNameComputerName Output CommandType Name Version Source --- --- --- --- Cmdlet Add-Computer 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Clear-EventLog 3.1.0.0 Microsoft.PowerShell...
Enter-PSSession需要Get-Command、Out-Default和Exit-PSSessioncmdlet。 如果远程计算机上的会话配置中不包含这些 cmdlet,则Enter-PSSession命令将失败。 与Invoke-Command不同,该命令在将命令发送到远程计算机之前对其进行分析和解释,Enter-PSSession直接将命令发送到远程计算机,而无需解释。
Get-Command命令可以一键列出PowerShell支持的所有命令,同时能按照关键词缩小命令的查找范围,如图所示。 使用语法如下: 代码语言:javascript 代码运行次数:0 运行 AI代码解释 Get-Command[[-Name]<string[]>] 下面对参数进行说明。 — [-Name] <string[]>:检索指定名称的cmdlet或命令元素,参数“<string[]>”就是...
在控制台提示符下键入help,按回车键后提示help的相关信息,从中可以看到help是Get-Help重新封装过的: PS C:\Documents and Settings\Administrator> help TOPIC Get-Help SHORT DESCRIPTION Displays help about Windows PowerShell cmdlets and concepts. LONG DESCRIPTION ...
Get-LocalUser -Name "username" 将"username" 替换为你想要查找的特定用户名。这个命令将返回与该用户名匹配的用户账号信息。 PowerShell 中,你可以使用以下命令来获取本地管理员的信息: powershellCopy Code Get-LocalGroupMember -Group "Administrators" 这个命令将返回属于 "Administrators" 组的成员信息,其中包括...
Invoke-Command -ComputerName Server01 -Credential Domain01\User01 -ScriptBlock { Get-Culture }ComputerName 参数指定远程计算机的名称。 凭据参数用于在 Domain01\User01(有权运行命令的用户)的安全上下文中运行该命令。 ScriptBlock 参数指定要在远程计算机上运行的命令。作为...