Microsoft Docs - 最新文章
docs.microsoft.com 是 Microsoft 技術文件的新首頁,讓內容的 Web 體驗,還有您用來了解、管理及部署解決方案的內容建立和支援方式更先進。 您可以在這裡一次找到所有與 Microsoft 技術相關的內容。為了確保您可以隨時掌握 docs.microsoft.com 上新功能和精彩內容的最新資訊,我們為您建立了專用摘要。
Selected Feed: PowerShell
探索 PowerShell - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/discover-powershell PowerShell is a powerful tool that can help people working in a multitude of roles. Traditionally, PowerShell has been used by the System Administrator role but is now being used by people calling themselves DevOps, Cloud Ops, and even Developers. PowerShell cmdlets PowerShell comes with hundreds of preinstalled commands.Published Date : 2023年1月31日
PowerShell 文件 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/ PowerShell Documentation Official product documentation for PowerShell Get Started Overview Download Setup and installation How-To Guide Sample scripts Deploy PowerShell Gallery Reference PowerShell Module Browser Architecture PowerShell on GitHub PowerShell Editions + Tools Available editions, tools, and technology that supports PowerShell Power…Published Date : 2022年5月19日
PowerShell@2 - PowerShell v2 工作
https://learn.microsoft.com/zh-tw/azure/devops/pipelines/tasks/reference/powershell-v2 powershell在 Windows) 上使用 Windows PowerShell (或 pwsh (Linux 和 macOS) 執行。 pwsh 會執行 PowerShell Core,這是建置在 .NET Core 上之 PowerShell 的跨平臺版本。 設定變數,以便後續腳本和工作讀取變數 若要深入瞭解如何在腳本中定義組建變數,請參閱 在腳本中定義和修改組建變數。 若要深入瞭解如何在腳本中定義發行變數,請參閱 在腳本中定義和修改發行變數。 在腳本中傳遞管線秘密,但管線記錄中不會遮罩秘密 請注意,PowerShell 會截斷錯誤訊息,因此如果您在腳本中使用管線密碼,則可以修剪並公開秘密。Published Date : 2023年3月6日
關於使用 PowerShell 執行 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/about/about_run_with_powershell 若要使用「搭配 PowerShell 執行」功能: 在 檔案總管 (或 Windows 檔案總管) 中,以滑鼠右鍵按一下指令檔名,然後選取 [使用 PowerShell 執行]。 「使用 PowerShell 執行」功能會啟動具有略過執行原則的 PowerShell 會話、執行腳本,以及關閉會話。 它會執行具有下列格式的命令: 「使用 PowerShell 執行」只會針對會話設定略過執行原則, (執行腳本的 PowerShell 進程目前實例) 。 此功能不會變更電腦或使用者的執行原則。 「使用 PowerShell 執行」功能只會受到 AllSigned 執行原則的影響。 如果 AllSigned 執行原則對電腦或使用者有效,「使用 PowerShell 執行」只會執行已簽署的腳本。Published Date : 2022年9月19日
關於 PowerShell exe - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/about/about_powershell_exe -Command 執行指定的命令 (和任何參數) ,如同在 PowerShell 命令提示字元中輸入,然後結束,除非 NoExit 指定參數。 Command的值可以是 - 、腳本區塊或字串。 如果 Command 的值是 - ,則會從標準輸入讀取命令文字。 Command參數只接受腳本區塊來執行,當它可以將傳遞至Command的值辨識為ScriptBlock類型時。 只有在從另一個 PowerShell 主機執行 powershell.exe 時,才可能這樣做。 ScriptBlock類型可能包含在現有變數中、從運算式傳回,或由 PowerShell 主機剖析為以大括弧括住的常值腳本區塊, () {} ,再傳遞至 powershell.exe 。Published Date : 2023年2月8日
PowerShell 支援 - Power Platform
https://learn.microsoft.com/zh-tw/power-platform/admin/powerapps-powershell 安裝 若要執行適用於應用程式建立者的 PowerShell Cmdlet,請執行下列動作: 以系統管理員身分執行 PowerShell。 使用下列命令匯入必要的模組: 或者,沒有電腦的系統管理員權限時,您也可以使用 -Scope CurrentUser 參數進行安裝: 如果系統提示您接受對存放庫 InstallationPolicy 值的變更,請針對每個模組輸入 [A] 並按下輸入,接受所有模組的 [A] Yes。 在存取任何命令之前,您可以選擇使用下列命令提供您的認證。 這些認證會重新整理至大約 8 小時的時間,之後您需要再次登入以繼續使用 Cmdlet。Published Date : 2023年2月28日
關於函式 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/about/about_functions 使用 函式尋找和管理函式:磁片磁碟機 PowerShell 中的所有函式和篩選都會自動儲存在磁片磁碟機中 Function: 。 PowerShell 函 式提供者會公開此磁片磁碟機。 參照 Function: 磁片磁碟機時,請在 Function後面輸入冒號,就像參考 C 電腦的 或 D 磁片磁碟機一樣。 下列命令會顯示 PowerShell 目前會話中的所有函式: 函式中的命令會儲存為函式定義屬性中的腳本區塊。 例如,若要在 PowerShell 隨附的說明函式中顯示命令,請輸入: 您也可以使用下列語法。 如需磁片磁碟機的詳細資訊 Function: ,請參閱 函 式提供者的說明主題。 輸入 Get-Help Function。Published Date : 2023年1月23日
PowerShell 簡介 - Training
https://learn.microsoft.com/zh-tw/training/modules/introduction-to-powershell/ 本課程模組將介紹 PowerShell,這是針對工作自動化與設定管理所建置的跨平台命令列殼層與指令碼語言。 . This module introduces PowerShell, a cross-platform command-line shell and scripting language built for task automation and configuration management.. PowerShell 簡介 模組 7 單位 初級 開發人員 學生 Azure 了解 PowerShell 的基本知識。 此跨平台命令列殼層與指令碼語言是針對工作自動化與組態管理所建置。 您將了解什麼是 PowerShell、PowerShell 的用途與使用方式等基本知識。Published Date : 2022年12月2日
開始使用 PowerShell - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/learn/ps101/01-getting-started 重新開機 PowerShell 主控台,但這次請在 [Windows PowerShell] 捷徑上按一下滑鼠右鍵,然後選取 [以系統管理員身分執行] (如圖 1-5 所示)。 如果您是以一般使用者的身分登入 Windows,系統會提示您輸入認證。 我會輸入使用者帳戶的認證,其身分為網域使用者和本機系統管理員 (如圖 1-6 所示)。 以系統管理員身分重新啟動 PowerShell 後,標題列應該會顯示「系統管理員:Windows PowerShell」(如圖 1-7 所示)。 現在 PowerShell 是以本機系統管理員提升權限的身分執行,因此,在本機電腦上執行命令而通常需要提示提高權限時,不會再出現 UAC 的問題。Published Date : 2022年11月17日
簡介 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/learn/ps101/00-introduction 這是一本針對 PowerShell 初學者的入門書籍。 本書著重於在 Microsoft Active Directory 網域環境中的 Windows 10 和 Windows Server 2016 上執行的 PowerShell 5.1 版。 不過,基本概念適用於在支援平台上執行的所有 PowerShell 版本。 關於本書 本書彙集我在開始學習 PowerShell 時希望有人告訴我的內容,以及我在過去 10 年中使用 PowerShell 時所學到的技巧、訣竅和最佳作法。 本書不會提供大量的資訊,而是會嘗試為 PowerShell 初學者提供順利使用的足夠資訊。 每一章都包含特定說明主題的連結,以方便使用者進一步瞭解該章節所涵蓋的主題。Published Date : 2022年12月9日
在殼層中執行命令 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/learn/shell/running-commands PowerShell 關鍵字的範例包括: for 、 foreach 、 try 、 catch 、 和 trap 。 Shell 語言關鍵字只能在殼層的執行時間環境中使用。 殼層外部沒有提供關鍵字功能的可執行檔。 OS 原生命令 是安裝在作業系統中的可執行檔。 可執行檔可以從任何命令列殼層執行,例如 PowerShell。 這包括可能需要其他殼層正常運作的腳本檔案。 例如,如果您在 PowerShell 中執行 Windows 批次腳本 (檔案) .cmd ,PowerShell 就會執行 cmd.exe 並傳入批次檔以進行執行。 Shell 環境規格命令 是在外部檔案中定義的命令,只能在殼層的執行時間環境中使用。 這些包括腳本和函式,也可以是特別編譯的模組,可將命令新增至殼層執行時間。Published Date : 2023年1月19日
關於設定檔 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/about/about_profiles PowerShell 設定檔是在 PowerShell 啟動時執行的指令碼。 您可以使用設定檔作為登入腳本來自訂環境。 您可以新增命令、別名、函式、變數、嵌入式管理單元、模組和 PowerShell 磁片磁碟機。 您也可以將其他會話特定元素新增至設定檔,以便在每個會話中使用它們,而不需要匯入或重新建立它們。 PowerShell 支援數個使用者和主機程式的設定檔。 不過,它不會為您建立設定檔。 本主題描述設定檔,並說明如何在您的電腦上建立和維護設定檔。 它說明如何使用 PowerShell 主控台的 NoProfile 參數, () pwsh.exe 來啟動 PowerShell,而不需要任何設定檔。 而且,它會說明 PowerShell 執行原則對設定檔的影響。Published Date : 2022年11月15日
在 Ubuntu 上安裝 PowerShell - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/install/install-ubuntu PowerShell is supported on Ubuntu for the following processor architectures. Ubuntu 7.2 (LTS-current) 7.3 7.4 (preview) All supported versions x64, Arm32 x64, Arm32 x64, Arm32 Installation support Microsoft supports the installation methods in this document. There may be other methods of installation available from other third-party sources.Published Date : 2023年3月17日
如何撰寫 PowerShell 指令碼模組 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/developer/module/how-to-write-a-powershell-script-module PowerShell 會使用模組資訊清單檔來組織及部署您的解決方案。 如需詳細資訊,請參閱 如何撰寫 PowerShell 模組資訊清單。 若要安裝和執行模組,請將模組儲存至其中一個適當的 PowerShell 路徑,並使用 Import-Module 。 您可以在全域變數中 $env:PSModulePath 安裝模組的路徑。 例如,在系統上儲存模組的常見路徑為 %SystemRoot%/users/<user>/Documents/PowerShell/Modules/<moduleName> 。 請務必為模組建立與腳本模組同名的目錄,即使它只是單 .psm1 一檔案也一樣。 如果您未將模組儲存到其中一個路徑,則必須在 Import-Module 命令中指定模組的位置。Published Date : 2022年6月9日
啟動 Windows PowerShell - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/windows-powershell/starting-windows-powershell 從 [開始] 功能表 按一下 [開始],並輸入 PowerShell,然後按一下 [Windows PowerShell]。 從 [開始] 功能表中,依序按一下 [開始]、[所有程式]、[附屬應用程式]、[Windows PowerShell] 資料夾和 [Windows PowerShell]。 在命令提示字元中 在 cmd.exe、Windows PowerShell 或 Windows PowerShell ISE 中,若要啟動 Windows PowerShell,請鍵入︰ 您也可以使用 powershell.exe 程式的參數來自訂工作階段。 如需詳細資訊,請參閱 PowerShell.exe 命令列說明。Published Date : 2021年11月8日
在 Linux 上安裝 PowerShell - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/install/installing-powershell-on-linux 替代安裝方法 在 Linux 上安裝 PowerShell 有三種方式,包括未正式支援的 Linux 發行版本。 您可以使用 PowerShell Snap 套件嘗試安裝 PowerShell。 您也可以嘗試使用 Linux tar.gz 直接部署 PowerShell 二進位檔。 如需詳細資訊,請參閱 在 Linux 上安裝 PowerShell 的替代方式。 . Install PowerShell on Linux Article 01/10/2023 4 minutes to read 1 contributor Feedback In this article PowerShell can be installed on different Linux distributions.Published Date : 2023年1月10日
關於重新導向 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/about/about_redirection 完整描述 根據預設,PowerShell 會將輸出傳送至 PowerShell 主機。 這通常是主控台應用程式。 不過,您可以將輸出重新導向至文字檔,並將錯誤輸出重新導向至一般輸出資料流程。 您可以使用下列方法來重新導向輸出: Out-File使用 Cmdlet,將命令輸出傳送至文字檔。 一般而言,當您 Out-File 需要使用 Cmdlet 的參數時,例如 Encoding 、 Force 、 Width 或 NoClobber 參數。 Tee-Object使用 Cmdlet,它會將命令輸出傳送至文字檔,然後將它傳送至管線。 使用 PowerShell 重新導向運算子。 將重新導向運算子與檔案目標搭配使用的功能相當於沒有額外參數的管線 Out-File 。Published Date : 2023年2月14日
使用 Visual Studio Code 開發 PowerShell - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/dev-cross-plat/vscode/using-vscode 搭配 PowerShell 擴充功能,其提供了豐富的互動式指令碼編輯體驗,讓您更輕鬆地撰寫可靠的 PowerShell 指令碼。 Visual Studio Code 搭配 PowerShell 延伸模組是撰寫 PowerShell 指令碼的建議編輯器。 其支援下列 PowerShell 版本: PowerShell 7.0 和更新版本 (Windows、macOS 和 Linux) Windows PowerShell 5.1 (僅限 Windows) 注意 Visual Studio Code與Visual Studio不同。 開始使用 在開始前,請先確定系統上有 PowerShell。Published Date : 2022年11月7日
適用於系統管理的範例指令碼 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/samples/sample-scripts-for-administration 適用於系統管理的範例指令碼 這組範例會逐步解說適合使用 PowerShell 來管理系統的案例。Published Date : 2022年12月9日
如何安裝 PowerShell 7
https://learn.microsoft.com/zh-tw/shows/it-ops-talk/how-to-install-powershell-7 PowerShell 7 is a new edition of PowerShell that is cross-platform (Windows, macOS, and Linux), open-source, and built for heterogeneous environments and the hybrid cloud. PowerShell 7 today is a side by side version next to Windows PowerShell 5.1.Published Date : 2021年11月16日
如何在 Windows PowerShell ISE 中撰寫和執行指令碼 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/windows-powershell/ise/how-to-write-and-run-scripts-in-the-windows-powershell-ise 如何建立和執行指令碼 您可以在指令碼窗格中開啟和編輯 Windows PowerShell 檔案。 Windows PowerShell 中需要注意的特定檔案類型包括指令碼檔案 (.ps1)、指令碼資料檔案 (.psd1) 和指令碼模組檔案 (.psm1)。 這些檔案類型是指令碼窗格編輯器中著色的語法。 其他可在指令碼窗格中開啟的常見檔案類型還包括組態檔 (.ps1xml)、XML 檔案和文字檔。 注意 Windows PowerShell 執行原則會決定您是否可以執行指令碼,以及載入 Windows PowerShell 設定檔和組態檔。 預設執行原則 “Restricted” 可防止所有指令碼執行,並防止載入設定檔。Published Date : 2022年6月29日
Azure PowerShell檔
https://learn.microsoft.com/zh-tw/powershell/azure/ Az PowerShell 模組簡介 支援生命週期 訓練 從 PowerShell 自動進行 Azure 工作 選擇管理及布建雲端基礎結構的最佳 Azure 命令列工具 安裝 下載 使用 PowerShell 安裝 使用 MSI 安裝 在 Azure Cloud Shell 中執行 在 Docker 中執行 最新消息 最新消息 版本資訊 Az 9.0.1 移轉指南 即將推出的中斷性變更 Azure PowerShell 參考 參考 Cmdlet 參考 身分識別和驗證 最新消息 Azure AD 至 Microsoft Graph 移轉變更 操作指南 驗證方法 建立服務主體 認證內容 概念 操作指南 管理訂閱 使用 Invoke-AzRestMethod 管理 Azure 資源 篩選 Cm…Published Date : 2023年3月9日
Azure Az PowerShell 模組簡介
https://learn.microsoft.com/zh-tw/powershell/azure/new-azureps-module-az PowerShell 提供強大的自動化功能,可用於管理您的 Azure 資源,例如 CI/CD 管線中的內容。 Az PowerShell 模組取代了 AzureRM,是用來與 Azure 互動的建議版本。 警告 由於 Az PowerShell 模組現在具備 AzureRM PowerShell 模組的所有功能,因此我們將於 2024 年 2 月 29 日淘汰 AzureRM PowerShell 模組。 若要避免服務中斷,請在 2024 年 2 月 29 日之前,將使用 AzureRM PowerShell 模組的指令碼更新為使用 Az PowerShell 模組。 若要自動更新您的指令碼,請遵循快速入門指南。Published Date : 2023年3月9日
使用檔案及資料夾 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/samples/working-with-files-and-folders 本文探討如何使用 PowerShell 來處理特定檔案和資料夾操作工作。 列出資料夾中的所有檔案和資料夾 您可以使用 直接在資料夾中 Get-ChildItem 取得所有專案。 加入選用的 Force 參數,以顯示隱藏或系統項目。 例如,此命令會顯示 PowerShell 磁片磁碟機 C: 的直接內容。 命令只會列出直接包含的專案,就像在 dir UNIX 殼層中使用 cmd.exels 命令一樣。 若要在子資料夾中顯示專案,您必須指定 Recurse 參數。 下列命令會列出磁片磁碟機上 C: 的所有內容: Get-ChildItem 可以使用項目的 Path、Filter、Include 與 Exclude 參數來加以篩選,但那些參數通常只以名稱為基礎。Published Date : 2022年12月9日
手動下載套件 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/gallery/how-to/working-with-packages/manual-download 最簡單的方法是從資料夾中移除 NuGet 特定項目。 移除那些元素會留下套件作者所建立的 PowerShell 程式碼。 針對 NuGet 特定元素清單,請參閱使用手動下載來取得套件。 步驟如下: 將從網際網路下載的 NuGet 套件 (.nupkg) 檔案解除封鎖,例如使用 Unblock-File -Path C:\Downloads\module.nupkg Cmdlet。 將 NuGet 套件內容解壓縮至本機資料夾。 從資料夾中刪除 NuGet 特定項目。 重新命名資料夾。 預設資料夾名稱通常是 <name>.<version>。 如果模組標記為發行前版本,則版本可以包含 -prerelease。 請將資料夾重新命名為只有模組名稱。Published Date : 2022年11月17日
Exchange Online PowerShell
https://learn.microsoft.com/zh-tw/powershell/exchange/exchange-online-powershell 若要瞭解 Exchange Online PowerShell 中的收件者篩選,請參閱Exchange 管理命令介面中的收件者篩選器和Exchange Online PowerShell 命令。 若要瞭解 Exchange Online PowerShell 中九個獨佔Get-EXO* Cmdlet 的收件者篩選,請參閱Exchange Online PowerShell 模組中的篩選器。 若要瞭解 Exchange Online PowerShell 模組中九個獨佔Get-EXO* Cmdlet 中的屬性集,請參閱Exchange Online PowerShell 模組 Cmdlet 中的屬性集。 .Published Date : 2022年9月20日
Windows PowerShell 5.1 與 PowerShell 7.x 之間的差異 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/whats-new/differences-from-windows-powershell PowerShell 會在 Windows、macOS 和 Linux 上執行。 Windows PowerShell與 PowerShell 之間的 PowerShell 語言有一些差異。 最值得注意的差異在於 Windows 和非 Windows 平臺之間的 PowerShell Cmdlet 可用性和行為,以及源自.NET Framework與 .NET Core 之間差異的變更。 本文摘要說明Windows PowerShell與目前 PowerShell 版本之間的重大差異和重大變更。 此摘要不包含已新增的新功能或 Cmdlet。 本文也不會討論版本之間的變更。 本文的目標是呈現 PowerShell 的目前狀態,以及與Windows PowerShell有何不同。Published Date : 2022年11月17日
安裝 PowerShellGet - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/gallery/installing-psget 以滑鼠右鍵按一下 PowerShell 圖示,然後選擇 [ 以系統管理員身分執行 ] 以啟動提升許可權的會話。 有兩種方式可以安裝 NuGet 提供者: 安裝其他模組之前,使用 Install-PackageProvider 來安裝 NuGet 執行下列命令以安裝 NuGet 提供者。 安裝提供者之後,您應該能夠搭配使用任何PowerShellGet Cmdlet 搭配 PowerShell 資源庫。 提示您 Install-Module 安裝 NuGet 提供者 下列命令會嘗試在沒有 NuGet 提供者的情況下安裝更新的 PowerShellGet 模組。 Install-Module 會提示您安裝 NuGet 提供者。 輸入 Y 以安裝提供者。Published Date : 2022年11月17日
下載並安裝 Windows PowerShell 5.1 - Skype for Business Online
https://learn.microsoft.com/zh-tw/skypeforbusiness/set-up-your-computer-for-windows-powershell/download-and-install-windows-powershell-5-1 電腦重新開機之後,確認Windows PowerShell可以啟動,而且應用程式可以在系統管理認證下執行。 若要執行此動作: 按一下[開始],依序按一下[所有程式]、[配件]、[Windows PowerShell]、以滑鼠右鍵按一下[Windows PowerShell],然後按一下 [以系統管理員身分執行]。 如果出現 [使用者帳戶控制] 對話方塊,請按一下 [ 是 ],確認您要在系統管理員認證下執行 PowerShell。 PowerShell 主機出現時,您應該確認 WinRM 服務正在執行且已正確設定。Published Date : 2021年8月26日
安裝 MSOnline
https://learn.microsoft.com/zh-tw/powershell/azure/active-directory/install-msonlinev1 Windows PowerShell 引進 Cmdlet (唸成 "command-let") 概念,這是內建於殼層的簡單、單一函式命令列工具。 Cmdlet 的命名慣例如下︰以破折號 (-) 分隔動詞和名詞,例如 Get-Help、Get-Process 和 Start-Service。 Windows PowerShell 包含一百個以上的基本核心 Cmdlet。 如需 Windows PowerShell 的詳細資訊,請參閱 開始使用 Windows PowerShell(英文)。 .Published Date : 2022年9月20日
使用 Azure PowerShell 登入
https://learn.microsoft.com/zh-tw/powershell/azure/authenticate-azureps 針對 PowerShell 7.x 和更新版本,此程式更為複雜。 下列指令碼會示範如何將現有憑證匯入至 PowerShell 可存取的憑證存放區。 在 Windows PowerShell 5.1 中匯入憑證 在 PowerShell 7.x 和更新版本中匯入憑證 使用受控識別登入 受控識別是 Azure Active Directory 的功能。 受控識別是指派給在 Azure 中執行之資源的服務主體。 您可以使用受控識別服務主體進行登入,以及僅限應用程式存取權杖來存取其他資源。 只有在 Azure 雲端中執行的虛擬機器才能使用受控識別。 此範例會使用主機環境的受控識別來連線。Published Date : 2023年3月9日
Start-Job (Microsoft.PowerShell.Core) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/start-job PowerShell 背景作業會執行命令,而不需與目前的會話互動。 當您啟動背景作業時,即使作業需要較長的時間才能完成,工作物件也會立即傳回。 工作執行時,您可以在工作階段中繼續工作,而不需中斷。 工作物件包含作業的實用資訊,但不包含作業結果。 當作業完成時,請使用 Receive-Job Cmdlet 來取得作業的結果。 如需背景工作的詳細資訊,請參閱 about_Jobs。 若要在遠端電腦上執行背景工作,請使用許多 Cmdlet 上可用的 AsJob 參數,或使用 Invoke-Command Cmdlet 在遠端電腦上執行 Start-Job 命令。 如需詳細資訊,請參閱 about_Remote_Jobs。Published Date : 2022年12月12日
使用 MSI 安裝 Azure PowerShell
https://learn.microsoft.com/zh-tw/powershell/azure/install-az-ps-msi 若要在非 Windows 平臺或更新版本的 PowerShell 上安裝, 請使用 PowerShell 安裝。 若要判斷您的 PowerShell 版本,請執行 命令: 若要在 PowerShell 5.1 中使用 Azure PowerShell,您需要: 視需要更新至 Windows PowerShell 5.1。 如果您是在 Windows 10 上,則已安裝 PowerShell 5.1。 安裝 .NET Framework 4.7.2 或更新版本。Published Date : 2023年3月9日
New-PSSession (Microsoft.PowerShell.Core) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/new-pssession SSH 型 PowerShell 遠端會話的優點是它可以跨多個平臺運作, (Windows、Linux、macOS) 。 針對 SSH 型會話,您可以使用 HostName 或 SSHConnection 參數集來指定遠端電腦和相關連線資訊。 如需如何設定 PowerShell SSH 遠端功能的詳細資訊,請參閱 透過 SSH 的 PowerShell 遠端處理。 注意 從 Linux 或 macOS 用戶端搭配 HTTPS 端點使用 WSMan 遠端處理時,伺服器憑證不受信任 (例如自我簽署憑證) 。 您必須提供PSSessionOption,其中包含設定為 $true的 SkipCACheck和SkipCNCheck值,才能成功建立連線。Published Date : 2022年12月9日
開始使用 Azure PowerShell
https://learn.microsoft.com/zh-tw/powershell/azure/get-started-azureps 在 Azure Cloud Shell 中安裝或執行 開始使用 Azure PowerShell 最簡單的方式是在 Azure Cloud Shell 環境中試用。 若要啟動並執行 Cloud Shell,請參閱 Azure Cloud Shell 中的 PowerShell 快速入門。 Cloud Shell 會在 Linux 容器上執行 PowerShell,因此無法使用 Windows 特有的功能。 當您準備好在本機電腦上安裝 Azure PowerShell 時,請遵循安裝 Azure PowerShell 模組中的指示。 登入 Azure 請使用 Connect-AzAccount Cmdlet,以互動方式登入。 如果您使用 Cloud Shell,請略過此步驟。Published Date : 2023年3月9日
下載 SQL Server PowerShell 模組 - SQL Server
https://learn.microsoft.com/zh-tw/sql/powershell/download-sql-server-ps-module 您可以使用 PowerShell 擴充功能,在 Azure Data Studio 中提供豐富的 PowerShell 編輯器支援。 安裝或更新 SqlServer 模組 若要從PowerShell 資源庫安裝 SqlServer 模組,請啟動PowerShell會話並執行 Install-Module SQLServer 。 如果在 Windows PowerShell 上執行,您可以使用 Install-Module SQLServer -Scope CurrentUser 來只為目前使用者安裝模組,並避免需要提高的許可權。Published Date : 2023年2月28日
Import-Module (Microsoft.PowerShell.Core) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/import-module 模組是包含可在 PowerShell 中使用的成員的套件。 成員包括 Cmdlet、提供者、腳本、函式、變數和其他工具和檔案。 在匯入模組之後,您可以在工作階段中使用模組成員。 如需模組的詳細資訊,請參閱 about_Modules。 根據預設,匯 Import-Module 入模組匯出的所有成員,但您可以使用 Alias、 Function、 Cmdlet和 Variable 參數來限制匯入的成員。 NoClobber參數可防止 Import-Module 匯入與目前會話中成員同名的成員。 Import-Module 只會將模組匯入目前的會話。 若要將模組匯入每個新的會話,請將命令新增 Import-Module 至您的 PowerShell 設定檔。Published Date : 2022年12月12日
SQL Server PowerShell - SQL Server
https://learn.microsoft.com/zh-tw/sql/powershell/sql-server-powershell 作業步驟在 PowerShell 腳本中的第 1 行收到錯誤。 對應的行是 'import-module SQLPS'。 更正腳本並重新排程作業。 PowerShell 傳回的錯誤資訊是:「指定的模組 'SQLPS' 未載入,因為任何模組目錄中都找不到有效的模組檔案。 SQLPS 模組必須位於環境變數 PSModulePath。 卸載 SSMS 16.x 可能會從 PSModulePath 移除 SQLPS。 若要檢查 PSModulePath 中儲存的目前值,請執行下列 PowerShell: 如果已設定路徑,您會看到類似 C:\Program Files (x86)\Microsoft SQL Server\130\Tools\PowerShell\Modules 的專案。Published Date : 2023年2月28日
安裝 Microsoft Teams PowerShell - Microsoft Teams
https://learn.microsoft.com/zh-tw/microsoftteams/teams-powershell-install 所有 Windows 平臺都支援 Microsoft Teams PowerShell 模組。 不支援 Mac 和 Linux。 需求 Microsoft Teams PowerShell 模組在所有平臺上都需要 PowerShell 5.1 或更新版本。 安裝適用于您作業系統 的最新版 PowerShell 。 若要檢查您的 PowerShell 版本,請在 PowerShell 會話中執行下列命令: 建議您使用Install-Module Cmdlet 來安裝 Microsoft Teams PowerShell 模組。Published Date : 2022年5月25日
關於雜湊表 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/about/about_hash_tables 在 PowerShell 中,每個雜湊表都是 Hashtable[System.Collections.Hashtable] 物件。 您可以在 PowerShell 中使用 物件的屬性和方法 Hashtable 。 從 PowerShell 3.0 開始,您可以使用 [ordered] 屬性在 PowerShell 中建立 [System.Collections.Specialized.OrderedDictionary] 物件。 已排序的字典與雜湊表不同,因為索引鍵一律會以您列出它們的順序顯示。 雜湊表中的索引鍵順序不會決定。 雜湊表中的索引鍵和值也是 .NET 物件。 它們通常是字串或整數,但可以有任何物件類型。 您也可以建立巢狀雜湊表,其中索引鍵的值是另一個雜湊表。Published Date : 2022年12月16日
在 Windows PowerShell 中變更 Planner 的先決條件 - Microsoft Planner
https://learn.microsoft.com/zh-tw/office365/planner/prerequisites-for-powershell 下載 Planner 租用戶系統管理員 PowerShell 檔案。 將檔解壓縮到您可從 PowerShell 存取的位置。 解除封鎖您的檔案 您必須「解除封鎖」在 Planner 租用戶系統管理員 PowerShell 套件中下載的兩個檔案,才能在 PowerShell 中使用它們。 這是因為根據預設,系統不允許執行從網際網路下載的指令碼。 您必須解除封鎖的檔案為: plannertenantadmin.psm1 microsoft.identity.client.dll 執行下列動作來解除封鎖這些檔案: 在 [檔案總管] 中,移至您要解壓縮檔案的位置。 以滑鼠右鍵按一下上述其中一個解壓縮檔案,並按一下 [內容]。 在 [一般] 索引標籤上,選取 [解除封鎖]。 選取 [確定]。Published Date : 2023年3月14日
Format-Table (Microsoft.PowerShell.Utility) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.utility/format-table PowerShell 會使用預設格式器來定義物件類型的顯示方式。 您可以使用 .ps1xml 檔案來建立自訂檢視,以顯示具有指定屬性的輸出資料表。 建立自訂檢視之後,請使用 View 參數來顯示具有自訂檢視的資料表。 如需檢視的詳細資訊,請參閱 about_Format.ps1xml。 您可以使用雜湊表將匯出屬性新增至物件,再顯示該物件,以及指定資料表中的資料行標題。 若要新增匯出屬性,請使用 Property 或 GroupBy 參數。 如需雜湊表的相關詳細資訊,請參閱 about_Hash_Tables。 .Published Date : 2022年12月13日
Test-Path (Microsoft.PowerShell.Management) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.management/test-path 範例 2:測試組態檔的路徑 這些命令會測試 PowerShell 設定檔的路徑。 第一個命令會判斷路徑中的所有元素是否都存在。 第二個命令會判斷路徑的語法是否正確。 在此情況下,路徑為 $False ,但語法正確 $True 。 這些命令會使用 $profile ,即使設定檔不存在,指向設定檔位置的自動變數也一樣。 如需自動變數的詳細資訊,請參閱 about_Automatic_Variables。 範例 3:檢查指定的類型以外是否有任何檔案 此命令會檢查商業建築物目錄中是否有任何檔案,而不是 .dwg 檔案。 此命令會使用 Path 參數來指定路徑。 因為路徑包含空格,所以路徑會以引號括住。 路徑尾端的星號會指示 Commercial Building 目錄的內容。Published Date : 2023年2月16日
Enable-PSRemoting (Microsoft.PowerShell.Core) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/enable-psremoting 單一電腦上可以並存多個 PowerShell 安裝。 執行 Enable-PSRemoting 會針對您執行 Cmdlet 的特定安裝版本設定遠端端點。 因此,如果您在執行 PowerShell 6.2 時執行 Enable-PSRemoting ,則會設定執行 PowerShell 6.2 的遠端端點。 如果您在執行 PowerShell 7 預覽版時執行 Enable-PSRemoting ,則會設定執行 PowerShell 7-preview 的遠端端點。 Enable-PSRemoting 視需要建立兩個遠端端點組態。 如果端點組態已經存在,則只會確保啟用它們。 建立的組態完全相同,但名稱不同。 其中一個名稱會對應至裝載會話的 PowerShell 版本。Published Date : 2022年12月9日
Configuration Manager PowerShell cmdlets - Configuration Manager
https://learn.microsoft.com/zh-tw/powershell/sccm/overview 來自 Configuration Manager 主控台的 PowerShell 開啟 PowerShell 的最簡單方法是直接從 Configuration Manager 主控台。 啟動 Configuration Manager 主控台。 左上角有一個藍色矩形。 選取藍色矩形中的白色箭號,然後選擇 [透過Windows PowerShell連線]。 載入Windows PowerShell之後,您會看到包含月臺碼的提示。 例如,如果月臺碼是 「ABC」,提示如下所示: PS ABC:\> 若要確認其運作正常,請使用 Get-CMSite Cmdlet。 此 Cmdlet 會傳回您目前連線的Configuration Manager網站和任何子月臺的相關資訊。Published Date : 2022年10月3日
Move-Item (Microsoft.PowerShell.Management) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.management/move-item FileSystem提供者是唯一支援使用篩選的已安裝 PowerShell 提供者。 您可以在about_Wildcards中找到FileSystem篩選語言的語法。 篩選比其他參數更有效率,因為提供者會在 Cmdlet 取得物件時套用它們,而不是在擷取物件之後讓 PowerShell 篩選物件。 Type:String Position:Named Default value:None Accept pipeline input:False Accept wildcard characters:True -Force 強制執行命令而不要求使用者確認。 實作會依提供者而異。 如需詳細資訊,請參閱 about_Providers。Published Date : 2022年12月13日
Sort-Object (Microsoft.PowerShell.Utility) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.utility/sort-object 如果命令中未包含排序屬性,PowerShell 會使用第一個輸入物件的預設排序屬性。 如果輸入物件的類型沒有預設的排序屬性,PowerShell 會嘗試比較物件本身。 如需詳細資訊,請參閱 附注 一節。 您可以依單一屬性或多個屬性排序物件。 多個屬性會使用雜湊表以遞增順序、遞減順序或排序次序的組合排序。 屬性會以區分大小寫或不區分大小寫的方式排序。 使用 Unique 參數從輸出中移除重複專案。 . The Sort-Object cmdlet sorts objects in ascending or descending order based on object property values.Published Date : 2022年12月13日
Connect-ExchangeOnline (ExchangePowerShell)
https://learn.microsoft.com/zh-tw/powershell/module/exchange/connect-exchangeonline 範例 7 在使用模組 2.0.4 版或更新版本的 PowerShell 7.0.3 或更新版本中,此範例會直接在 PowerShell 視窗中傳遞認證,連線到互動式腳本案例中的 Exchange Online PowerShell。 參數 -AccessToken 注意:此參數可在模組的 3.1.0-Preview1 版或更新版本中使用。 AccessToken 參數會指定用來連線至 ExchangeOnline 的 OAuth JSON Web 權杖 (JWT) 。 視存取權杖的類型而定,您必須搭配組織、DelegatedOrganization 或 UserPrincipalName 參數使用此參數。Published Date : 2023年3月21日
Start-Sleep (Microsoft.PowerShell.Utility) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.utility/start-sleep Start-Sleep (Microsoft.PowerShell.Utility) - PowerShell. /powershell/module/microsoft.powershell.utility/start-sleep. Cmdlet Start-Sleep 會在指定的時段內暫停腳本或會話中的活動。 您可以將它用於許多工作,例如等待操作完成,或先暫停再重複執行一項操作。 . The Start-Sleep cmdlet suspends the activity in a script or session for the specified period of time.Published Date : 2023年1月23日
ConvertTo-Json (Microsoft.PowerShell.Utility) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.utility/convertto-json This cmdlet was introduced in Windows PowerShell 3.0. Examples Example 1 This command uses the ConvertTo-Json cmdlet to convert a GregorianCalendar object to a JSON-formatted string. Example 2 This example shows the output from ConvertTo-Json cmdlet with and without the AsArray switch parameter.Published Date : 2022年12月13日
Start-Transcript (Microsoft.PowerShell.Host) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.host/start-transcript Cmdlet Start-Transcript 會建立文字檔中所有或部分 PowerShell 會話的記錄。 文字記錄包含使用者輸入的所有命令,以及顯示在主控台上的所有輸出。 從 Windows PowerShell 5.0 開始, Start-Transcript 在所有文字記錄產生的檔案名中包含主機名稱。 當您的企業記錄會集中管理時,這特別有用。 Cmdlet 所建立的 Start-Transcript 檔案會包含名稱中的隨機字元,以避免在同時啟動兩個或多個文字記錄時,可能會覆寫或重複。 這也可以防止未經授權探索儲存於集中式檔案共用中的文字記錄。 如果目標檔案沒有 Byte Order Mark (BOM) , Start-Transcript 則預設 Utf8NoBom 為目標檔案中的編碼方式。Published Date : 2022年12月12日
探索 Windows PowerShell ISE - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/windows-powershell/ise/exploring-the-windows-powershell-ise 此文章是 Windows PowerShell ISE 的功能概觀Published Date : 2022年9月22日
Get-Credential (Microsoft.PowerShell.Security) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.security/get-credential Cmdlet Get-Credential 會為指定的使用者名稱和密碼建立認證物件。 您可以在安全性作業中使用認證物件。 Cmdlet Get-Credential 會提示使用者輸入密碼或使用者名稱和密碼。 您可以使用 Message 參數在命令列提示字元中指定自訂訊息。Published Date : 2022年12月13日
什麼是 PowerShell 命令? - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/powershell-commands PowerShell 的命令稱為 Cmdlet, (發音為 command-lets)Published Date : 2022年11月17日
關於模組 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/about/about_modules 說明如何安裝、匯入和使用 PowerShell 模組。Published Date : 2022年9月19日
尋找執行任何 Exchange 指令程式所需的權限
https://learn.microsoft.com/zh-tw/powershell/exchange/find-exchange-cmdlet-permissions 系統管理員可以瞭解如何使用 PowerShell 來尋找在 powerShell 或 Exchange Server Exchange Online PowerShell 中執行任何 Cmdlet 所需的許可權。Published Date : 2023年2月16日
關於邏輯運算子 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/about/about_logical_operators 描述在 PowerShell 中連接語句的運算子。Published Date : 2022年9月19日
Enter-PSSession (Microsoft.PowerShell.Core) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/enter-pssession Cmdlet 會 Enter-PSSession 啟動具有單一遠端電腦的互動式會話。 在會話期間,您輸入的命令會在遠端電腦上執行,就像是在遠端電腦上直接輸入一樣。 您一次只能有一個互動式工作階段。 通常,您會使用 ComputerName 參數來指定遠端電腦的名稱。 不過,您也可以使用互動式會話的 New-PSSession Cmdlet 建立的會話。 不過,您無法使用 Disconnect-PSSession 、 Connect-PSSession 或 Receive-PSSession Cmdlet 來中斷連線或重新連線到互動式會話。 從 PowerShell 6.0 開始,您可以使用安全殼層 (SSH) 建立與遠端電腦的連線,如果本機電腦上有 SSH 可用,且遠端電腦已設定 PowerShell SSH 端點。 SSH 型 PowerShell 遠端會話的優點是它可以跨多個平臺運作, (Windows、Linux、macOS) 。 針對 SSH 型遠端處理,您可以使用 HostName 參數集來指定遠端電腦和相關連線資訊。 如需如何設定 PowerShell SSH 遠端處理的詳細資訊,請參閱 透過 SSH 進行 PowerShell 遠端處理。 若要結束互動式會話並中斷與遠端電腦的連線,請使用 Exit-PSSession Cmdlet 或輸入 exit 。Published Date : 2022年12月9日
PnP PowerShell 概觀
https://learn.microsoft.com/zh-tw/powershell/sharepoint/sharepoint-pnp/sharepoint-pnp-cmdlets PnP PowerShell 概觀Published Date : 2022年3月11日
關於運算子 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/about/about_operators 描述 PowerShell 支援的運算子。Published Date : 2022年12月5日
使用 PowerShell 將Microsoft 365 授權指派給使用者帳戶 - Microsoft 365 Enterprise
https://learn.microsoft.com/zh-tw/microsoft-365/enterprise/assign-licenses-to-user-accounts-with-microsoft-365-powershell 在本文中,瞭解如何使用 PowerShell 將Microsoft 365 授權指派給未授權的使用者。Published Date : 2022年12月6日
關於自動變數 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/about/about_automatic_variables 描述儲存 PowerShell 狀態資訊的變數。 PowerShell 會建立和維護這些變數。Published Date : 2023年3月17日
使用 Hyper-V 與 Windows PowerShell
https://learn.microsoft.com/zh-tw/virtualization/hyper-v-on-windows/quick-start/try-hyper-v-powershell 使用 Hyper-V 與 Windows PowerShellPublished Date : 2022年4月26日
PowerShell
https://learn.microsoft.com/zh-tw/windows-server/administration/windows-commands/powershell PowerShell 命令的參考文章,此命令會從命令提示字元開啟 PowerShell 主控台。Published Date : 2023年2月3日
快速入門:上傳、下載及列出 Blob - Azure PowerShell - Azure Storage
https://learn.microsoft.com/zh-tw/azure/storage/blobs/storage-quickstart-blobs-powershell 在本快速入門中,您會在物件 (Blob) 儲存體中使用 Azure PowerShell。 然後使用 PowerShell,將 blob 上傳至 Azure 儲存體、下載 blob,以及列出容器中的 blob。Published Date : 2022年11月7日
關於管線 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/about/about_pipelines 將命令結合至 PowerShell 中的管線Published Date : 2022年9月19日
連線至 Exchange Online Protection PowerShell
https://learn.microsoft.com/zh-tw/powershell/exchange/connect-to-exchange-online-protection-powershell 瞭解如何使用 Exchange Online PowerShell V2 模組或 V3 模組,透過新式驗證和/或多重要素驗證 (MFA) 連線到獨立Exchange Online Protection PowerShell。Published Date : 2023年3月9日
建立自訂輸入方塊 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/samples/creating-a-custom-input-box 本文說明如何使用 Windows PowerShell 中的 .NET Framework 表單建置功能,建立自訂輸入方塊。Published Date : 2022年12月9日
快速入門 - 使用 PowerShell 從 Key Vault 設定&擷取秘密
https://learn.microsoft.com/zh-tw/azure/key-vault/secrets/quick-create-powershell 在本快速入門中,您將了解如何使用 Azure PowerShell 從 Azure Key Vault 建立、擷取和刪除祕密。Published Date : 2022年5月24日
什麼是 Azure PowerShell
https://learn.microsoft.com/zh-tw/powershell/azure/what-is-azure-powershell 本文介紹 Azure PowerShell 及其功能。Published Date : 2023年3月9日
Set-Alias (Microsoft.PowerShell.Utility) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.utility/set-alias Cmdlet Set-Alias 會建立或變更 Cmdlet 或命令的別名,例如函式、腳本、檔案或其他可執行檔。 別名是參考 Cmdlet 或命令的替代名稱。 例如, sal 是 Cmdlet 的 Set-Alias 別名。 如需詳細資訊,請參閱 about_Aliases。 Cmdlet 可以有多個別名,但別名只能與一個 Cmdlet 相關聯。 您可以使用 Set-Alias 將現有的別名重新指派給另一個 Cmdlet,或變更別名的屬性,例如描述。 所 Set-Alias 建立或變更的別名不是永久的,而且只能在目前的 PowerShell 會話期間使用。 關閉 PowerShell 會話時,會移除別名。Published Date : 2022年12月13日
使用登錄項目 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/samples/working-with-registry-entries 本文討論如何使用 PowerShell 來處理登錄項目。Published Date : 2022年12月9日
您想知道有關於 $null 的一切 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/learn/deep-dives/everything-about-null PowerShell $null 常常看起來很簡單,但其實有很多細微差異。 讓我們仔細看一下 $null,您就會知道當您意外遇到 Null 值時,會發生什麼事。Published Date : 2022年11月17日
關於喜好設定變數 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/about/about_preference_variables 自訂 PowerShell 行為的變數。Published Date : 2023年3月2日
Add-Content (Microsoft.PowerShell.Management) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.management/add-content Cmdlet 會將 Add-Content 內容附加至指定的專案或檔案。 您可以在命令中輸入內容或透過指定包含內容的物件指定內容。 如果您需要為下列範例建立檔案或目錄,請參閱 New-Item。Published Date : 2022年12月13日
使用登錄機碼 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/samples/working-with-registry-keys 本文討論如何使用 PowerShell 來處理登錄機碼。Published Date : 2022年12月9日
Get-Command (Microsoft.PowerShell.Core) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/get-command Cmdlet Get-Command 會取得電腦上安裝的所有命令,包括 Cmdlet、別名、函式、篩選、腳本和應用程式。 Get-Command 會從 PowerShell 模組和從其他會話匯入的命令取得命令。 若只要取得已經匯入目前工作階段的命令,請使用 ListImported 參數。 如果沒有參數, Get-Command 請取得電腦上安裝的所有 Cmdlet、函式和別名。 Get-Command * 會取得所有類型的命令,包括 Path 環境變數中的所有非 PowerShell 檔案, ($env:Path) ,它會在應用程式命令類型中列出。 Get-Command 會使用命令的確切名稱,而不使用萬用字元,會自動匯入包含命令的模組,以便立即使用 命令。 若要啟用、停用和設定模組的自動匯入,請使用 $PSModuleAutoLoadingPreference 喜好設定變數。 如需詳細資訊,請參閱 about_Preference_Variables。 Get-Command 會直接從命令程式碼取得其資料,不同于 Get-Help ,它會從說明主題取得其資訊。 從 Windows PowerShell 5.0 開始,Cmdlet 的結果 Get-Command 預設會顯示Version資料行。 已將新的 Version 屬性新增至 CommandInfo 類別。Published Date : 2023年1月23日
Write-Progress (Microsoft.PowerShell.Utility) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.utility/write-progress Cmdlet 會在 Write-Progress PowerShell 命令視窗中顯示進度列,描述執行中命令或腳本的狀態。 您可以選擇進度列反映的指示器及進度列上下方顯示的文字。 PowerShell 7.2 新增 $PSStyle 了自動變數,用來控制 PowerShell 如何使用 ANSI 逸出序列顯示特定資訊。 成員 $PSStyle.Progress 可讓您控制進度檢視列呈現。 $PSStyle.Progress.Style - 設定轉譯樣式的 ANSI 字串。 $PSStyle.Progress.MaxWidth - 設定檢視的最大寬度。 預設值為 120。 最小值為 18。 $PSStyle.Progress.View - 具有值 Minimal 和 Classic 的列舉。 Classic 是沒有變更的現有轉譯。 Minimal 是單行最小轉譯。 Minimal 是預設值。 注意 如果主機不支援虛擬終端機, $PSStyle.Progress.View 則會自動設定為 Classic 。Published Date : 2022年12月13日
Stop-Process (Microsoft.PowerShell.Management) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.management/stop-process Cmdlet Stop-Process 會停止一或多個執行中的進程。 您可以透過進程名稱或進程識別碼來指定進程, (PID) ,或將進程物件傳遞至 Stop-Process 。 Stop-Process 僅適用于在本機電腦上執行的進程。 在 Windows Vista 和更新版本的 Windows 作業系統上,若要停止目前使用者未擁有的進程,您必須使用 [以系統管理員身分執行] 選項啟動 PowerShell。 此外,除非您指定 Confirm 參數,否則不會提示您進行確認。Published Date : 2023年1月5日
在單一 PowerShell 視窗中連線至所有 Microsoft 365 服務 - Microsoft 365 Enterprise
https://learn.microsoft.com/zh-tw/microsoft-365/enterprise/connect-to-all-microsoft-365-services-in-a-single-windows-powershell-window 摘要:在單一 PowerShell 視窗中連線至所有 Microsoft 365 服務。Published Date : 2022年9月29日
Get-Item (Microsoft.PowerShell.Management) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.management/get-item Cmdlet Get-Item 會取得位於指定位置的專案。 除非您使用萬用字元 () * 來要求專案的所有內容,否則它不會在位置取得專案的內容。 PowerShell 提供者會使用此 Cmdlet 來流覽不同類型的資料存放區。 某些參數僅適用于特定提供者。 如需詳細資訊,請參閱 about_Providers。Published Date : 2023年2月15日
Get-WmiObject (Microsoft.PowerShell.Management) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.management/get-wmiobject 從 PowerShell 3.0 開始,此 Cmdlet 已由 Get-CimInstance 取代。 Cmdlet Get-WmiObject 會取得 WMI 類別的實例或可用 WMI 類別的相關資訊。 若要指定遠端電腦,請使用 ComputerName 參數。 若指定 List 參數,此 Cmdlet 會取得在指定命名空間內可用的 WMI 類別相關資訊。 若指定 Query 參數,此 Cmdlet 會執行 WMI 查詢語言 (WQL) 陳述式。 Cmdlet Get-WmiObject 不會使用遠端Windows PowerShell來執行遠端作業。 即使您的電腦不符合Windows PowerShell遠端處理的需求,或未設定Windows PowerShell中的遠端處理,您也可以使用 Cmdlet 的 Get-WmiObjectComputerName參數。 從 Windows PowerShell 3.0 開始,傳回之 物件的 Get-WmiObject__Server屬性具有PSComputerName別名。 這樣比較容易在輸出和報告中包含來源電腦名稱。Published Date : 2023年3月10日
Get-ItemProperty (Microsoft.PowerShell.Management) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.management/get-itemproperty Cmdlet Get-ItemProperty 會取得指定專案的屬性。 例如,您可以使用這個 Cmdlet 來取得檔案物件的 LastAccessTime 屬性值。 您也可以使用此 Cmdlet 來檢視登錄專案及其值。Published Date : 2022年12月13日
Add-Member (Microsoft.PowerShell.Utility) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.utility/add-member Cmdlet Add-Member 可讓您將成員 (屬性和方法,) 新增至 PowerShell 物件的實例。 例如,您可以新增 NoteProperty 成員,其中包含物件的描述,或執行腳本的 ScriptMethod 成員來變更物件。 若要使用 Add-Member ,請使用 管線將 物件傳送至 Add-Member ,或使用 InputObject 參數來指定 物件。 MemberType參數會指出您要新增的成員類型。 Name參數會將名稱指派給新的成員,而Value參數會設定成員的值。 您新增的屬性和方法只會新增到您指定之物件特定的執行個體。 Add-Member 不會變更物件類型。 若要建立新的物件類型,請使用 Add-Type Cmdlet。 您也可以使用 Export-Clixml Cmdlet,將 物件的實例儲存在檔案中,包括其他成員。 然後,您可以使用 Import-Clixml Cmdlet,從儲存在匯出檔案中的資訊重新建立 物件的實例。 從 Windows PowerShell 3.0 開始,具有新功能, Add-Member 可讓您更輕鬆地將記事屬性新增至物件。 您可以使用 NotePropertyName 和 NotePropertyValue 參數來定義附註屬性,或使用 NotePropertyMembers 參數以採用附註屬性名稱和值的雜湊表。 此外,自 Windows PowerShell 3.0 起,需使用會產生輸出物件之 PassThru 參數的頻率較少。 Add-Member 現在,會將新成員直接新增至更多類型的輸入物件。 如需詳細資訊,請參閱 PassThru 參數描述。Published Date : 2022年12月13日
在 Azure 自動化 中使用受控識別建立 PowerShell Runbook
https://learn.microsoft.com/zh-tw/azure/automation/learn/powershell-runbook-managed-identity 在本教學課程中,您將瞭解如何在 Azure 自動化 中搭配 PowerShell Runbook 使用受控識別。Published Date : 2023年3月9日
安裝 PowerShell 模組 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/developer/module/installing-a-powershell-module 安裝 PowerShell 模組Published Date : 2022年11月15日
Migrate from Azure AD PowerShell to Microsoft Graph PowerShell.
https://learn.microsoft.com/en-us/powershell/microsoftgraph/migration-steps Migrate your applications from Azure AD PowerShell to Microsoft Graph PowerShell.Published Date : 2022年9月21日
在 Red Hat Enterprise Linux (RHEL) 上安裝 PowerShell - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/install/install-rhel 在 Red Hat Enterprise Linux (RHEL) 上安裝 PowerShell 的相關資訊Published Date : 2023年3月17日
將 Azure PowerShell 解除安裝
https://learn.microsoft.com/zh-tw/powershell/azure/uninstall-az-ps 如何執行 Azure PowerShell 完全解除安裝Published Date : 2023年3月9日
安裝 AzureAD PowerShell for Graph
https://learn.microsoft.com/zh-tw/powershell/azure/active-directory/install-adv2 這提供 Azure AD PowerShell 模組的安裝程式指南。Published Date : 2022年2月15日
Microsoft Graph PowerShell SDK overview
https://learn.microsoft.com/en-us/powershell/microsoftgraph/overview Learn about the features of Microsoft Graph PowerShell that can help you derive insights and analytics, and build unique, intelligent apps.Published Date : 2022年12月14日
單行式與管線 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/learn/ps101/04-pipelines PowerShell 單行程式碼是包含多個命令的一個連續管線,用來完成單一工作。Published Date : 2022年12月9日
關於特殊字元 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.core/about/about_special_characters 描述控制 PowerShell 如何解譯序列中下一個字元的特殊字元序列。Published Date : 2023年1月12日
搭配使用指令碼與 PowerShell 將 Azure 工作自動化 - Training
https://learn.microsoft.com/zh-tw/training/modules/automate-azure-tasks-with-powershell/ 了解如何在 Linux、macOS 或 Windows 上安裝 Azure PowerShell,並接著連線到 Azure 及管理您的資源。Published Date : 2023年2月1日
Read-Host (Microsoft.PowerShell.Utility) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.utility/read-host Cmdlet 會 Read-Host 從主控台讀取一行輸入, (stdin) 。 您可以使用它來提示使用者輸入。 因為您可以將輸入儲存為安全字串,所以您可以使用此 Cmdlet 來提示使用者輸入安全資料,例如密碼。 注意 Read-Host 限制為 1022 個字元,可接受為使用者的輸入。Published Date : 2022年12月13日
安全性與合規性 PowerShell
https://learn.microsoft.com/zh-tw/powershell/exchange/scc-powershell 瞭解如何使用安全性&合規性 PowerShell。Published Date : 2022年12月13日
Windows PowerShell ISE 的鍵盤快速鍵 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/windows-powershell/ise/keyboard-shortcuts-for-the-windows-powershell-ise 此文章是 PowerShell ISE 中所使用的鍵盤快速鍵清單。Published Date : 2022年10月25日
PowerShell 中的指令碼簡介 - Training
https://learn.microsoft.com/zh-tw/training/modules/script-with-powershell/ 瞭解如何使用 PowerShell 撰寫指令碼。Published Date : 2023年3月10日
您想知道有關於 Switch 陳述式的一切 - PowerShell
https://learn.microsoft.com/zh-tw/powershell/scripting/learn/deep-dives/everything-about-switch PowerShell 中的 Switch 陳述式提供了在其他語言中無法找到的功能。Published Date : 2022年11月17日
Select-Xml (Microsoft.PowerShell.Utility) - PowerShell
https://learn.microsoft.com/zh-tw/powershell/module/microsoft.powershell.utility/select-xml Cmdlet Select-Xml 可讓您使用 XPath 查詢來搜尋 XML 字串和檔中的文字。 輸入 XPath 查詢,並使用 Content、 Path或 Xml 參數指定要搜尋的 XML 。Published Date : 2022年11月15日