{"content":"<div></div>","rawMetadata":{"metadata":{"_op_canonicalUrlPrefix":"https://learn.microsoft.com/zh-cn/powershell/","_op_gitContributorInformation":{"author":{"display_name":"Banreet Kaur","id":"92906285","name":"Banreet","profile_url":"https://github.com/Banreet"},"contributors":[{"display_name":"Aaron Czechowski","id":"26784733","name":"aczechowski","profile_url":"https://github.com/aczechowski"},{"display_name":"Sean Wheeler","id":"19415881","name":"sdwheeler","profile_url":"https://github.com/sdwheeler"},{"display_name":"Dan Mabee","id":"40476441","name":"damabe","profile_url":"https://github.com/damabe"},{"display_name":"Jonathan Gao","id":"2213767","name":"mumian","profile_url":"https://github.com/mumian"}],"update_at":"2026/6/25","updated_at_date_time":"2026-06-25T23:03:00.8393947Z"},"_path":"module/configurationmanager/get-cmscript.json","_rel":"../../","_tocRel":"../sccm-ps/toc.json","apiPlatform":"powershell","author":"Banreet","breadcrumb_path":"/powershell/sccm/bread/toc.json","canonical_url":"https://learn.microsoft.com/zh-cn/powershell/module/configurationmanager/get-cmscript?view=sccm-ps","content_git_url":"https://github.com/MicrosoftDocs/sccm-docs-powershell-ref/blob/main/sccm-ps/ConfigurationManager/Get-CMScript.md","default_moniker":"sccm-ps","depot_name":"MSDN.sccm-powershell","document_id":"542e191c-28f7-2da2-9e9b-75e8ea44e4b5","document_version_independent_id":"6671c5ee-687e-3001-2e55-f40ec8e336f5","external help file":"AdminUI.PS.dll-Help.xml","feedback_product_url":"https://feedbackportal.microsoft.com/feedback/forum/4669adfc-ee1b-ec11-b6e7-0022481f8472","feedback_system":"Standard","git_commit_id":"2de6091be6fb706d31e84a0c5d3a5b0d07974400","gitcommit":"https://github.com/MicrosoftDocs/sccm-docs-powershell/blob/2de6091be6fb706d31e84a0c5d3a5b0d07974400/sccm-ps/ConfigurationManager/Get-CMScript.md","github_contributors":["aczechowski","sdwheeler","damabe","mumian"],"locale":"zh-cn","manager":"laurawi","Module Name":"ConfigurationManager","monikers":["sccm-ps"],"ms.author":"dannygu","ms.date":"12/28/2021","ms.service":"configuration-manager","ms.subservice":"other","ms.topic":"reference","open_to_public_contributors":true,"original_content_git_url":"https://github.com/MicrosoftDocs/sccm-docs-powershell/blob/live/sccm-ps/ConfigurationManager/Get-CMScript.md","original_content_git_url_template":"{repo}/blob/{branch}/sccm-ps/ConfigurationManager/Get-CMScript.md","PlatyPS schema version":"2.0.0","products":["https://authoring-docs-microsoft.poolparty.biz/devrel/f1499c3b-793f-48c3-a9ce-20285bcc6541"],"site_name":"Docs","title":"Get-CMScript","titleSuffix":"Configuration Manager","uhfHeaderId":"MSDocsHeader-Powershell","updated_at":"2026-06-25 11:03 PM","xrefs":[{"href":"https://learn.microsoft.com/powershell/module/configurationmanager/get-cmscript","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"Get-CMScript","schemaType":"PowershellCmdlet","summary":"<p>在 Configuration Manager 中获取 PowerShell 脚本。</p>\n","uid":"ConfigurationManager.Get-CMScript"}],"ocv-translation-feedback":true},"_xrefmap":{"ConfigurationManager":{"href":"./","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"ConfigurationManager","schemaType":"PowershellModule","uid":"ConfigurationManager"},"ConfigurationManager.Get-CMScript":{"href":"get-cmscript","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"Get-CMScript","schemaType":"PowershellCmdlet","summary":"<p>在 Configuration Manager 中获取 PowerShell 脚本。</p>\n","uid":"ConfigurationManager.Get-CMScript"}},"description":"<p>使用此 cmdlet 获取 Configuration Manager PowerShell 脚本。 这些脚本在 Configuration Manager 中集成和管理。 有关详细信息，请参阅 <a href=\"/mem/configmgr/apps/deploy-use/create-deploy-scripts\">从 Configuration Manager 控制台创建和运行 PowerShell 脚本</a>。</p>\n<div class=\"NOTE\">\n<p>注意</p>\n<p>从 Configuration Manager 站点驱动器运行 Configuration Manager cmdlet，例如 <code>PS XYZ:\\&gt;</code>。 有关详细信息，请参阅 <a href=\"/powershell/sccm/overview\">入门</a>。</p>\n</div>\n","examples":[{"code":"Get-CMScript -Fast | Where-Object { -not $_.ApprovalState }","description":"","summary":"<p>此命令获取 Configuration Manager 中未批准的所有脚本。</p>\n","title":"示例 1：获取所有未批准的脚本"},{"code":"Get-CMScript -ScriptName \"D*\"","description":"","summary":"<p>此命令获取名称以字母 <code>D</code>开头的所有脚本。</p>\n","title":"示例 2：使用名称获取脚本"},{"code":"Get-CMScript -Fast -Author \"*jqpublic\" | Select-Object ScriptName, ApprovalState, LastUpdateTime","description":"","summary":"<p>此命令获取用户名为 <strong>jqpublic</strong> 的作者的所有脚本。 由于它使用星号 (<code>*</code>) 通配符，因此特定域并不重要。 然后，它返回一个表，其中列出了脚本名称、审批状态和上次更新时间。</p>\n","title":"示例 3：从特定作者获取脚本"}],"inputs":[{"description":"","name":"<span class=\"no-loc xref\">None</span>\n"}],"links":[{"href":"approve-cmscript","text":"Approve-CMScript"},{"href":"deny-cmscript","text":"Deny-CMScript"},{"href":"invoke-cmscript","text":"Invoke-CMScript"},{"href":"new-cmscript","text":"New-CMScript"},{"href":"remove-cmscript","text":"Remove-CMScript"},{"href":"set-cmscript","text":"Set-CMScript"},{"href":"/mem/configmgr/apps/deploy-use/create-deploy-scripts","text":"从 Configuration Manager 控制台创建并运行 PowerShell 脚本"}],"module":"ConfigurationManager","name":"Get-CMScript","notes":"<p>此 cmdlet 返回 <strong>SMS_Scripts</strong> WMI 类的对象。</p>\n","outputs":[{"description":"","name":"<span class=\"no-loc xref\">IResultObject[]</span>\n"},{"description":"","name":"<span class=\"no-loc xref\">IResultObject</span>\n"}],"parameters":[{"acceptWildcardCharacters":true,"aliases":"","defaultValue":"None","description":"<p>指定要获取的脚本的作者。 例如，<code>contoso\\jqpublic</code>。</p>\n<p>可以使用通配符：</p>\n<ul>\n<li>\n              <code>*</code>：多个字符</li>\n<li>\n              <code>?</code>：单个字符</li>\n</ul>\n","name":"Author","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>此参数将通配符视为文本字符值。 不能将其与 <strong>ForceWildcardHandling</strong> 组合使用。</p>\n","name":"DisableWildcardHandling","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>添加此参数以不自动刷新延迟属性。 延迟属性包含检索效率相对较低的值。 获取这些属性可能会导致额外的网络流量并降低 cmdlet 性能。</p>\n<p>如果不使用此参数，cmdlet 将显示警告。 若要禁用此警告，请设置 <code>$CMPSSuppressFastNotUsedCheck = $true</code>。</p>\n","name":"Fast","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>此参数处理通配符，并可能导致意外行为， (不建议) 。 不能将其与 <strong>DisableWildcardHandling</strong> 组合使用。</p>\n","name":"ForceWildcardHandling","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">SwitchParameter</span>\n"},{"aliases":"","defaultValue":"None","description":"<p>适用于版本 2010 及更高版本。 指定要获取的脚本的 GUID。</p>\n","isRequired":true,"name":"ScriptGuid","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"},{"acceptWildcardCharacters":true,"aliases":"","defaultValue":"None","description":"<p>指定要获取的脚本名称。</p>\n<p>可以使用通配符：</p>\n<ul>\n<li>\n              <code>*</code>：多个字符</li>\n<li>\n              <code>?</code>：单个字符</li>\n</ul>\n","name":"ScriptName","parameterValueGroup":"","position":"Named","type":"<span class=\"no-loc xref\">String</span>\n"}],"schema":"PowershellCmdlet","summary":"<p>在 Configuration Manager 中获取 PowerShell 脚本。</p>\n","syntaxes":["Get-CMScript [-Author <String>] [-Fast] [-ScriptName <String>] [-DisableWildcardHandling]\n [-ForceWildcardHandling] [<CommonParameters>]","Get-CMScript [-Author <String>] [-Fast] -ScriptGuid <String> [-DisableWildcardHandling]\n [-ForceWildcardHandling] [<CommonParameters>]"],"uid":"ConfigurationManager.Get-CMScript","hideEdit":true,"ms.translationtype":"MT","ms.contentlocale":"zh-cn","loc_version":"2024-08-21T21:18:36.7205003Z","loc_source_id":"Github-72476255#live","loc_file_id":"Github-72476255.live.MSDN.sccm-powershell.sccm-ps/ConfigurationManager/Get-CMScript.md","xrefs":[{"href":"https://learn.microsoft.com/powershell/module/configurationmanager/get-cmscript","monikerGroup":"f98fea35b6ac2b0f56c6ee5ec06ffce9","name":"Get-CMScript","schemaType":"PowershellCmdlet","summary":"<p>在 Configuration Manager 中获取 PowerShell 脚本。</p>\n","uid":"ConfigurationManager.Get-CMScript"}],"canonical_url":"https://learn.microsoft.com/zh-cn/powershell/module/configurationmanager/get-cmscript?view=sccm-ps","_op_canonicalUrl":"https://learn.microsoft.com/zh-cn/powershell/module/configurationmanager/get-cmscript?view=sccm-ps"},"pageMetadata":"<meta name=\"description\" content=\"<p>使用此 cmdlet 获取 Configuration Manager PowerShell 脚本。 这些脚本在 Configuration Manager 中集成和管理。 有关详细信息，请参阅 <a href=&quot;/mem/configmgr/apps/deploy-use/create-deploy-scripts&quot;>从 Configuration Manager 控制台创建和运行 PowerShell 脚本</a>。</p>\n<div class=&quot;NOTE&quot;>\n<p>注意</p>\n<p>从 Configuration Manager 站点驱动器运行 Configuration Manager cmdlet，例如 <code>PS XYZ:\\&amp;gt;</code>。 有关详细信息，请参阅 <a href=&quot;/powershell/sccm/overview&quot;>入门</a>。</p>\n</div>\n\" />\r\n<meta name=\"hideEdit\" content=\"true\" />\r\n<meta name=\"loc_file_id\" content=\"Github-72476255.live.MSDN.sccm-powershell.sccm-ps/ConfigurationManager/Get-CMScript.md\" />\r\n<meta name=\"loc_source_id\" content=\"Github-72476255#live\" />\r\n<meta name=\"loc_version\" content=\"2024-08-21T21:18:36.7205003Z\" />\r\n<meta name=\"module\" content=\"ConfigurationManager\" />\r\n<meta name=\"ms.contentlocale\" content=\"zh-cn\" />\r\n<meta name=\"ms.translationtype\" content=\"MT\" />\r\n<meta name=\"name\" content=\"Get-CMScript\" />\r\n<meta name=\"notes\" content=\"<p>此 cmdlet 返回 <strong>SMS_Scripts</strong> WMI 类的对象。</p>\n\" />\r\n<meta name=\"schema\" content=\"PowershellCmdlet\" />\r\n<meta name=\"summary\" content=\"<p>在 Configuration Manager 中获取 PowerShell 脚本。</p>\n\" />\r\n<meta name=\"syntaxes\" content=\"Get-CMScript [-Author <String>] [-Fast] [-ScriptName <String>] [-DisableWildcardHandling]\n [-ForceWildcardHandling] [<CommonParameters>]\" />\r\n<meta name=\"syntaxes\" content=\"Get-CMScript [-Author <String>] [-Fast] -ScriptGuid <String> [-DisableWildcardHandling]\n [-ForceWildcardHandling] [<CommonParameters>]\" />\r\n<meta name=\"uid\" content=\"ConfigurationManager.Get-CMScript\" />\r\n","themesRelativePathToOutputRoot":"_themes/"}