找到 2042 篇文章 適用於 Microsoft 技術

Get-Process 命令在 PowerShell 中有什麼作用?

Chirag Nagrekar
更新於 2020-01-22 10:34:31

568 次瀏覽

Get-Process 是一個 PowerShell cmdlet,用於獲取 Windows 終端中所有正在執行的後臺程序的例項。在任務管理器“程序”選項卡中顯示的任何程序,其所有執行緒都可以透過 Get-Process 命令在 PowerShell 控制檯中顯示。

如何在 PowerShell 中啟動依賴服務?

Chirag Nagrekar
更新於 2020-01-22 10:33:58

675 次瀏覽

要在 PowerShell 中啟動依賴服務,與使用 –Force 引數停止依賴服務不同,因為沒有可用的 –Force 引數。您需要先獲取依賴服務,然後啟動它們。Get-Service -Name Winmgmt -DependentServices | Start-Service -Verbose

如何使用 PowerShell 啟動多個 Windows 服務?

Chirag Nagrekar
更新於 2020-01-22 10:33:25

3K+ 次瀏覽

要使用 PowerShell 啟動多個服務,我們需要在服務之間使用逗號 (,)。例如,Start-Service -Name Spooler,AdobeARMservice -VerboseGet-Service -Name Spooler,AdobeARMservice | Start-Service -Verbose要使用顯示名稱啟動服務,Start-Service -Name “Print Spooler”, “Work Folder” -Verbose Get-Service -Name “Print Spooler”, “Work Folder” | Start-Service -Verbose

如何在 PowerShell 中使用顯示名稱啟動 Windows 服務?

Chirag Nagrekar
更新於 2020-01-22 10:32:28

738 次瀏覽

要使用顯示名稱停止服務,請使用引數 –DisplayName。例如,PS C:\> Start-Service -DisplayName "Print Spooler" -Verbose VERBOSE: Performing the operation "Start-Service" on target "Print Spooler (Spooler)".您也可以使用顯示名稱啟動服務,PS C:\> Get-Service -DisplayName "Print Spooler" | Start-Service -Verbose

如何在 PowerShell 中停止服務及其依賴服務?

Chirag Nagrekar
更新於 2020-01-22 10:26:00

2K+ 次瀏覽

要在 PowerShell 中停止具有依賴服務的服務,使用 -Force 引數。首先,我們將檢查特定服務的依賴服務是什麼,要獲取它們,使用 -DependentService 引數。示例例如,WMI 服務(名稱:Winmgmt)具有多個依賴服務。Get-Service -Name Winmgmt -DependentServicesOutputtatus   Name           DisplayName ------   ----           ----------- Running  UALSVC           User Access Logging Service Stopped  smstsmgr           ConfigMgr Task Sequence Agent Stopped  SepLpsService      Symantec Endpoint Protection Local ... Stopped  NcaSvc           ... 閱讀更多

如何在 PowerShell 中啟動 Windows 服務?

Chirag Nagrekar
更新於 2020-01-22 10:23:19

3K+ 次瀏覽

要啟動特定 Windows 服務,您需要使用 Start-Service 命令。示例Start-Service -Name Spooler上面的命令將啟動服務名稱 spooler。要檢查服務是否已啟動,請使用 Get-Service –Name Spooler 命令。OutputStatus Name DisplayName ------ ---- ----------- Running spooler Print Spooler此命令不會顯示命令進度。要檢查命令進度,請使用 –Verbose 引數。PS C:\> Start-Service -Name Spooler -Verbose VERBOSE: Performing the operation "Start-Service" on target "Print Spooler (Spooler)".您也可以使用以下命令啟動服務:Get-Service -Name Spooler | Start-Service -Verbose PS C:\> Get-Service -Name Spooler | Start-Service -Verbose VERBOSE: Performing the operation "Start-Service" on target "Print Spooler ... 閱讀更多

如何在 PowerShell 中停止服務及其依賴服務?

Chirag Nagrekar
更新於 2020-01-22 10:20:18

545 次瀏覽

可以透過在它們之間提供命令 (,) 來使用名稱或顯示名稱停止多個服務。使用名稱和顯示名稱,Stop-Service -Name Spooler, W32Time -Verbose Stop-Service -DisplayName "Print Spooler","Windows Time" -Verbose

如何在 PowerShell 中停止多個服務?

Chirag Nagrekar
更新於 2020-01-22 10:15:43

3K+ 次瀏覽

可以透過在它們之間提供命令 (,) 來使用名稱或顯示名稱停止多個服務。使用名稱和顯示名稱,Stop-Service -Name Spooler, W32Time -Verbose Stop-Service -DisplayName "Print Spooler","Windows Time" –Verbose

如何在 PowerShell 中停止具有顯示名稱的服務?

Chirag Nagrekar
更新於 2020-01-22 10:14:43

577 次瀏覽

與 -Name 引數類似,當您新增 -DisplayName 引數後跟服務顯示名稱時,它將停止具有 DisplayName 的服務。Stop-Service -DisplayName 'Print Spooler' -VerboseORGet-Service -DisplayName "Print Spooler" | Stop-Service -Verbose

如何在 PowerShell 中停止 Windows 服務?

Chirag Nagrekar
更新於 2020-01-22 08:07:43

22K+ 次瀏覽

要使用 PowerShell 停止特定服務,您需要使用 Stop-Service 命令。語法Stop-Service -Name ServiceName Stop-Service -DisplayName ServiceDisplayName示例Stop-Service -Name Spooler要檢查服務是否已停止,請鍵入 Get-Service -Name Spooler。OutputStatus   Name           DisplayName ------   ----           ----------- Stopped  Spooler           Print Spooler您也可以使用 -Verbose 引數來檢查命令程序。PS C:\Windows\system32> Stop-Service -Name spooler -Verbose VERBOSE: Performing the operation "Stop-Service" on target "Print Spooler (spooler)".您也可以使用以下命令執行停止服務:Get-Service -Name Spooler | Stop-Service -Verbose您也可以使用萬用字元 ... 閱讀更多

廣告

© . All rights reserved.