Set-AuthenticodeSignature 帮助信息

本文介绍如何使用Set-AuthenticodeSignature cmdlet对Windows PowerShell脚本进行签名,包括命令的基本语法、参数详情及使用示例。
 
如下说明是翻译: help Set-AuthenticodeSignature 产生的帮助信息.
译者: Edengundam(马涛)
 
Set-AuthenticodeSignature
 
大纲
使用验证码签名对Windows PowerShell脚本或其他文件进行签名.
 
语法
Set-AuthenticodeSignature [-filePath] <string[]> [-certificate] <X509Certificate2> [-includeChain <string>] [-timeStampServer <string>] [-force] [-whatIf] [-confirm] [<CommonParameters>]
 
详细描述
Set-AuthenticodeSignature cmdlet向任何支持会话初始化协议(SIP)文件添加验证码签名Windows PowerShell脚本文件中, 签名采用一段指出脚本中最后运行的命令位置的文本信息. 当时用此cmdlet, 如果已经有签名信息存在于脚本中, 该旧签名将会被删除.
 
参数
 
-filePath <string[]>
指定被签名的文件路径.
 
强制参数?
true
参数位置?
1
默认值
Null
允许从管道绑定输入?
true (根据值, 根据属性名)
允许通配符扩展?
true
 
-certificate <X509Certificate2>
指定被用来给脚本签名的证书. 输入一个包含表示证书的对象的变量或一个取得证书的表达式.
 
查找证书使用Get-PfxCertificateGet-ChildItem. 如果证书不可用, 或没有代码签名授权, 命令将会失败.
 
强制参数?
true
参数位置?
2
默认值
允许从管道绑定输入?
false
允许通配符扩展?
false
 
-includeChain <string>
确定证书信任链中哪些证书被包含在数字签名中. "NotRoot"为默认值.
 
合法取值如下:
 
·         "Signer": 只包含签名者的证书.
·         "NotRoot": 除了根颁发机构外, 证书链中的所有证书.
·         "All": 证书链中的所有证书.
 
强制参数?
false
参数位置?
named
默认值
notroot
允许从管道绑定输入?
false
允许通配符扩展?
false
 
-timeStampServer <string>
使用指定的时间戳服务器来保证向证书添加到文件中的准确时间. 以字符串形式输入时间戳服务器的URL.
 
强制参数?
false
参数位置?
named
默认值
 
允许从管道绑定输入?
false
允许通配符扩展?
false
 
-force <SwitchParameter>
在不破坏安全前提下, 能够避免影响命令成功执行的限制条件. 例如: Force参数能够覆盖具有只读属性的文件或创建路径中的必要成分, 但是不会改变人和文件的权限.
 
强制参数?
false
参数位置?
named
默认值
False
允许从管道绑定输入?
false
允许通配符扩展?
false
 
-whatIf
描述执行此命令将会发生的现象, 不会真正执行此命令.
 
强制参数?
false
参数位置?
named
默认值
 
允许从管道绑定输入?
false
允许通配符扩展?
false
 
-confirm
执行命令前提示你进行确认.
 
强制参数?
false
参数位置?
named
默认值
 
允许从管道绑定输入?
false
允许通配符扩展?
false
 
<公共参数>
此命令支持公共参数: -Verbose, -Debug, -ErrorAction, -ErrorVariable, and -OutVariable. 更多信息, 输入, "get-help about_commonparameters".
 
返回类型
PsSignatureObject
 
注意
 
更多信息, 输入"Get-Help Set-AuthenticodeSignature -detailed".需要技术信息, 输入"Get-Help Set-AuthenticodeSignature -full".
 
在将签名信息写入文件之前或在证书验证之后, PowerShell中的布尔类型的变量"SigningApproved"都会被检查如果该变量没有设置或设置为不是true值时, 方法ShouldProcess将会提示用户来确认脚本的签名.
 
如果提供了参数TimeStampServer, 将会为签名使用通过指定URL获得的时间戳.
 
参数"IncludeChain"指出信任链的哪些证书嵌入到签名块中. 此命令允许的三个参数:
 
·         None -- 只有签名者的证书将会被编码并嵌入到脚本中.
·         Notroot -- 除了根证书外, 签名者信任链上的所有证书将会被编码并嵌入到脚本中.
·         Fullchain --包括根证书, 签名者信任链上的所有证书将会被编码并嵌入到脚本中.
 
如果需要为该命令提供多个参数, 请使用逗号进行分隔. 例如, "<parameter-name> <value1>, <value2>".
 
1
 
C:/PS>$cert=Get-ChildItem -FilePath cert:/CurrentUser/my -CodeSigningCert
 
C:/PS>Set-AuthenticodeSignature PsTestInternet2.ps1 -cert $cert
 
这些命令从Windows PowerShell证书provider中取得代码签名的证书, 并使用它对Windows PowerShell脚本进行签名.
 
第一个命令使用Get-Childitem cmdletWindows PowerShell证书provider来获得证书仓库子目录Cert:/CurrentUser/My中的证书. (驱动器Cert: 是证书provider的使用接口.) 参数CodeSigningCert是只有证书provider才支持的, 限制只取得代码签名颁发机构的证书. 命令将结果保存在变量$cert.
 
第二个命令使用了Set-AuthenticodeSignature cmdlet来签名叫PSTestInternet2.ps1的脚本. 它使用了参数FilePath来指定脚本的名称, 以及参数Cert指示使用存储在变量$cert中的证书.
 
2
 
C:/PS>$cert = Get-PfxCertificate C:/Test/Mysign.pfx
 
C:/PS>Set-AuthenticodeSignature -Filepath ServerProps.ps1 -Cert $cert
 
此命令使用Get-PfxCertificate cmdlet来查找一个代码签名证书并使用它对Windows PowerShell脚本进行签名.
 
第一个命令使用Get-PfxCertificate cmdlet查找C:/Test/MySign.pfx证书并将其存储在变量$cert.
 
第二个命令Set-AuthenticodeSignature用来签名脚本. Set-AuthenticodeSignature的参数FilePath 指出被签名脚本的路径, 参数Cert将包含证书的变量$cert传递给Set-AuthenticodeSignature.
 
如果证书文件受到密码保护, Windows PowerShell将会提示您输入密码.
 
3
 
C:/PS>Set-AuthenticodeSignature -filepath c:/scripts/Remodel.ps1 -cert $cert -IncludeChain All -TimeStampServer "http://www.fabrikam.com/TimeManager"
 
此命令使用第三方时间戳服务器将信任链上包括根颁发机构的证书一起添加到数字签名中.
 
命令使用参数FilePath指定被签名的脚本位置, 参数Cert指定证书保存在变量$cert. 通过使用参数IncludeChain指定信任链中的所有证书证书(包含根颁发机构), 参数TimeStampServer指定了用于验证脚本签名时间的时间戳服务器的URL.
 
相关链接
Get-AuthenticodeSignature
Get-PfxCertificate
Get-ExecutionPolicy
Set-ExecutionPolicy
about_signing 
 
  
CurlTools.psd1:"@{ ModuleVersion = '1.0.0' RootModule = 'CurlTools.psm1' Author = 'Your Name' Description = '提供 curl 相关功能的 PowerShell 模块' FunctionsToExport = @('Invoke-CurlRequest') CompatiblePSEditions = @('Desktop', 'Core') PowerShellVersion = '5.1' }" 小蓝窗:“PS C:\Users\Administrator> # 检查模块路径 PS C:\Users\Administrator> $env:PSModulePath -split ';' C:\Users\Administrator\Documents\WindowsPowerShell\Modules E:\CurlTools\Modules C:\Users\Administrator\Documents\WindowsPowerShell\Modules E:\CurlTools\Modules C:\Users\Administrator\Documents\WindowsPowerShell\Modules C:\Users\Administrator\Documents\WindowsPowerShell\Modules C:\Program Files\WindowsPowerShell\Modules C:\Windows\system32\WindowsPowerShell\v1.0\Modules E:\CurlTools\Modules PS C:\Users\Administrator> PS C:\Users\Administrator> # 创建模块目录 (以当前用户作用域为例) PS C:\Users\Administrator> $modulePath = Join-Path $HOME "Documents\PowerShell\Modules\CurlTools" PS C:\Users\Administrator> New-Item -ItemType Directory -Path $modulePath -Force 目录: C:\Users\Administrator\Documents\PowerShell\Modules Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2025/8/16 0:43 CurlTools PS C:\Users\Administrator> PS C:\Users\Administrator> # 保存模块文件 PS C:\Users\Administrator> $moduleContent = @' >> <这里放置完整的Invoke-CurlRequest函数代码> >> '@ >> $moduleContent | Out-File -FilePath "$modulePath\CurlTools.psm1" -Encoding UTF8 >> PS C:\Users\Administrator> # 查看当前执行策略 PS C:\Users\Administrator> Get-ExecutionPolicy Get-ExecutionPolicy : 在模块“Microsoft.PowerShell.Security”中找到“Get-ExecutionPolicy”命令,但无法加载该模块。有关详细信息,请运行“Import-Module Mi crosoft.PowerShell.Security”。 所在位置 行:1 字符: 1 + Get-ExecutionPolicy + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Get-ExecutionPolicy:String) [], CommandNotFoundException + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule PS C:\Users\Administrator> PS C:\Users\Administrator> # 临时设置为可运行脚本 PS C:\Users\Administrator> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force Set-ExecutionPolicy : 在模块“Microsoft.PowerShell.Security”中找到“Set-ExecutionPolicy”命令,但无法加载该模块。有关详细信息,请运行“Import-Module Mi crosoft.PowerShell.Security”。 所在位置 行:1 字符: 1 + Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -For ... + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Set-ExecutionPolicy:String) [], CommandNotFoundException + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule PS C:\Users\Administrator> # 检查 curl 是否可用 PS C:\Users\Administrator> Get-Command curl -ErrorAction SilentlyContinue CommandType Name Version Source ----------- ---- ------- ------ Alias curl -> Invoke-WebRequest PS C:\Users\Administrator> PS C:\Users\Administrator> # 如果未安装,Windows 用户可安装: PS C:\Users\Administrator> winget install curl.Curl winget : 无法将“winget”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括路径,请确保路径正确,然后再试一次。 所在位置 行:1 字符: 1 + winget install curl.Curl + ~~~~~~ + CategoryInfo : ObjectNotFound: (winget:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException PS C:\Users\Administrator> # 或下载:https://curl.se/windows/ PS C:\Users\Administrator> $modulePath = Join-Path $HOME "Documents\PowerShell\Modules\CurlTools" PS C:\Users\Administrator> New-Item -ItemType Directory -Path $modulePath -Force 目录: C:\Users\Administrator\Documents\PowerShell\Modules Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2025/8/16 0:43 CurlTools PS C:\Users\Administrator> @' >> function Invoke-CurlRequest { >> # <完整的函数代码> >> } >> Export-ModuleMember -Function Invoke-CurlRequest >> '@ | Out-File -FilePath "$modulePath\CurlTools.psm1" -Encoding UTF8 >> PS C:\Users\Administrator> # 导入模块(需要先调整执行策略) PS C:\Users\Administrator> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force Set-ExecutionPolicy : 在模块“Microsoft.PowerShell.Security”中找到“Set-ExecutionPolicy”命令,但无法加载该模块。有关详细信息,请运行“Import-Module Mi crosoft.PowerShell.Security”。 所在位置 行:1 字符: 1 + Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -For ... + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Set-ExecutionPolicy:String) [], CommandNotFoundException + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule PS C:\Users\Administrator> Import-Module CurlTools -Force -Verbose 详细信息: 正在从路径“E:\CurlTools\Modules\CurlTools\CurlTools.psd1”加载模块。 详细信息: 正在从路径“E:\CurlTools\Modules\CurlTools\CurlTools.psm1”加载模块。 所在位置 E:\CurlTools\Modules\CurlTools\CurlTools.psm1:194 字符: 32 + $curlArgs += "'$key: $headerValue'" + ~~~~~ 变量引用无效。':' 后面的变量名称字符无效。请考虑使用 ${} 分隔名称。 + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : InvalidVariableReferenceWithDrive Import-Module : 未能处理要处理“CurlTools.psm1”的模块(即模块清单“E:\CurlTools\Modules\CurlTools\CurlTools.psd1”的“ModuleToProcess/RootMo dule”字段中列出的模块),因为在任何模块目录中都没有找到有效模块。 所在位置 行:1 字符: 1 + Import-Module CurlTools -Force -Verbose + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ResourceUnavailable: (CurlTools:String) [Import-Module], PSInvalidOperationException + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand PS C:\Users\Administrator> # 导入模块(需要先调整执行策略) PS C:\Users\Administrator> Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -Force Set-ExecutionPolicy : 在模块“Microsoft.PowerShell.Security”中找到“Set-ExecutionPolicy”命令,但无法加载该模块。有关详细信息,请运行“Import-Module Mi crosoft.PowerShell.Security”。 所在位置 行:1 字符: 1 + Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope Process -For ... + ~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Set-ExecutionPolicy:String) [], CommandNotFoundException + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule PS C:\Users\Administrator> Import-Module CurlTools -Force -Verbose 详细信息: 正在从路径“E:\CurlTools\Modules\CurlTools\CurlTools.psd1”加载模块。 详细信息: 正在从路径“E:\CurlTools\Modules\CurlTools\CurlTools.psm1”加载模块。 所在位置 E:\CurlTools\Modules\CurlTools\CurlTools.psm1:194 字符: 32 + $curlArgs += "'$key: $headerValue'" + ~~~~~ 变量引用无效。':' 后面的变量名称字符无效。请考虑使用 ${} 分隔名称。 + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : InvalidVariableReferenceWithDrive Import-Module : 未能处理要处理“CurlTools.psm1”的模块(即模块清单“E:\CurlTools\Modules\CurlTools\CurlTools.psd1”的“ModuleToProcess/RootMo dule”字段中列出的模块),因为在任何模块目录中都没有找到有效模块。 所在位置 行:1 字符: 1 + Import-Module CurlTools -Force -Verbose + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ResourceUnavailable: (CurlTools:String) [Import-Module], PSInvalidOperationException + FullyQualifiedErrorId : Modules_ModuleFileNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand PS C:\Users\Administrator> # 检查命令是否可用 PS C:\Users\Administrator> Get-Command Invoke-CurlRequest Get-Command : 无法将“Invoke-CurlRequest”项识别为 cmdlet、函数、脚本文件或可运行程序的名称。请检查名称的拼写,如果包括 路径,请确保路径正确,然后再试一次。 所在位置 行:1 字符: 1 + Get-Command Invoke-CurlRequest + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Invoke-CurlRequest:String) [Get-Command], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException,Microsoft.PowerShell.Commands.GetCommandCommand PS C:\Users\Administrator> PS C:\Users\Administrator> # 测试基本功能 PS C:\Users\Administrator> Invoke-CurlRequest -Url "https://www.example.com" -Verbose Invoke-CurlRequest : 在模块“CurlTools”中找到“Invoke-CurlRequest”命令,但无法加载该模块。有关详细信息,请运行“Import-Module CurlTools”。 所在位置 行:1 字符: 1 + Invoke-CurlRequest -Url "https://www.example.com" -Verbose + ~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Invoke-CurlRequest:String) [], CommandNotFoundException + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule PS C:\Users\Administrator> # 创建自签名证书 PS C:\Users\Administrator> $cert = New-SelfSignedCertificate -Type CodeSigningCert -Subject "CN=PowerShellCurlModule" PS C:\Users\Administrator> PS C:\Users\Administrator> # 签名模块 PS C:\Users\Administrator> Set-AuthenticodeSignature -FilePath "$modulePath\CurlTools.psm1" -Certificate $cert Set-AuthenticodeSignature : 在模块“Microsoft.PowerShell.Security”中找到“Set-AuthenticodeSignature”命令,但无法加载该模块。有关详细信息,请运行“Impo rt-Module Microsoft.PowerShell.Security”。 所在位置 行:1 字符: 1 + Set-AuthenticodeSignature -FilePath "$modulePath\CurlTools.psm1" -Cer ... + ~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Set-AuthenticodeSignature:String) [], CommandNotFoundException + FullyQualifiedErrorId : CouldNotAutoloadMatchingModule PS C:\Users\Administrator> PS C:\Users\Administrator> # 在模块开头添加兼容性检查 PS C:\Users\Administrator> if (-not (Get-Command curl -ErrorAction SilentlyContinue)) { >> throw "curl not found. Please install curl: https://curl.se/download.html" >> } >> PS C:\Users\Administrator> # 详细错误信息 PS C:\Users\Administrator> Import-Module CurlTools -Force -Verbose -Debug 详细信息: 正在从路径“E:\CurlTools\Modules\CurlTools\CurlTools.psd1”加载模块。 详细信息: 正在从路径“E:\CurlTools\Modules\CurlTools\CurlTools.psm1”加载模块。 确认 所在位置 E:\CurlTools\Modules\CurlTools\CurlTools.psm1:194 字符: 32 + $curlArgs += "'$key: $headerValue'" + ~~~~~ 变量引用无效。':' 后面的变量名称字符无效。请考虑使用 ${} 分隔名称。 [Y] 是(Y) [A] 全是(A) [H] 终止命令(H) [S] 暂停(S) [?] 帮助 (默认值为“Y”): 所在位置 E:\CurlTools\Modules\CurlTools\CurlTools.psm1:194 字符: 32 + $curlArgs += "'$key: $headerValue'" + ~~~~~ 变量引用无效。':' 后面的变量名称字符无效。请考虑使用 ${} 分隔名称。 + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : InvalidVariableReferenceWithDrive 确认 未能处理要处理“CurlTools.psm1”的模块(即模块清单“E:\CurlTools\Modules\CurlTools\CurlTools.psd1”的“ModuleToProcess/RootModule”字段中列出的模块),因 为在任何模块目录中都没有找到有效模块。 [Y] 是(Y) [A] 全是(A) [H] 终止命令(H) [S] 暂停(S) [?] 帮助 (默认值为“Y”):”
08-17
CommandType Name Version Source ----------- ---- ------- ------ Alias Get-PSResource 1.1.1 Microsoft.PowerShell.PSResourceGet Function Compress-Archive 1.2.5 Microsoft.PowerShell.Archive Function Compress-Archive 1.0.1.0 Microsoft.PowerShell.Archive Function ConvertFrom-SddlString 3.1.0.0 Microsoft.PowerShell.Utility Function Expand-Archive 1.2.5 Microsoft.PowerShell.Archive Function Expand-Archive 1.0.1.0 Microsoft.PowerShell.Archive Function Export-ODataEndpointProxy 1.0 Microsoft.PowerShell.ODataUtils Function Format-Hex 3.1.0.0 Microsoft.PowerShell.Utility Function Get-FileHash 3.1.0.0 Microsoft.PowerShell.Utility Function Get-OperationValidation 1.0.1 Microsoft.PowerShell.Operation.Validation Function Import-PowerShellDataFile 3.1.0.0 Microsoft.PowerShell.Utility Function Import-PSGetRepository 1.1.1 Microsoft.PowerShell.PSResourceGet Function Invoke-OperationValidation 1.0.1 Microsoft.PowerShell.Operation.Validation Function New-Guid 3.1.0.0 Microsoft.PowerShell.Utility Function New-TemporaryFile 3.1.0.0 Microsoft.PowerShell.Utility Cmdlet Add-Computer 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Add-Content 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Add-History 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Add-LocalGroupMember 1.0.0.0 Microsoft.PowerShell.LocalAccounts Cmdlet Add-Member 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Add-Type 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Checkpoint-Computer 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Clear-Content 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Clear-EventLog 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Clear-History 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Clear-Item 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Clear-ItemProperty 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Clear-RecycleBin 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Clear-Variable 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Compare-Object 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Complete-Transaction 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Compress-PSResource 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet Connect-PSSession 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Convert-Path 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Convert-String 3.1.0.0 Microsoft.PowerShell.Utility Cmdlet ConvertFrom-CliXml 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet ConvertFrom-Csv 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet ConvertFrom-Json 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet ConvertFrom-Markdown 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet ConvertFrom-SddlString 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet ConvertFrom-SecureString 7.0.0.0 Microsoft.PowerShell.Security Cmdlet ConvertFrom-String 3.1.0.0 Microsoft.PowerShell.Utility Cmdlet ConvertFrom-StringData 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet ConvertTo-CliXml 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet ConvertTo-Csv 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet ConvertTo-Html 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet ConvertTo-Json 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet ConvertTo-SecureString 7.0.0.0 Microsoft.PowerShell.Security Cmdlet ConvertTo-Xml 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Copy-Item 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Copy-ItemProperty 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Debug-Job 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Debug-Process 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Debug-Runspace 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Disable-ComputerRestore 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Disable-ExperimentalFeature 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Disable-LocalUser 1.0.0.0 Microsoft.PowerShell.LocalAccounts Cmdlet Disable-PSBreakpoint 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Disable-PSRemoting 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Disable-PSSessionConfiguration 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Disable-RunspaceDebug 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Disconnect-PSSession 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Enable-ComputerRestore 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Enable-ExperimentalFeature 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Enable-LocalUser 1.0.0.0 Microsoft.PowerShell.LocalAccounts Cmdlet Enable-PSBreakpoint 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Enable-PSRemoting 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Enable-PSSessionConfiguration 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Enable-RunspaceDebug 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Enter-PSHostProcess 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Enter-PSSession 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Exit-PSHostProcess 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Exit-PSSession 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Export-Alias 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Export-Clixml 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Export-Counter 3.0.0.0 Microsoft.PowerShell.Diagnostics Cmdlet Export-Csv 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Export-FormatData 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Export-ModuleMember 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Export-PSSession 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Find-PSResource 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet ForEach-Object 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Format-Custom 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Format-Hex 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Format-List 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Format-Table 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Format-Wide 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-Acl 7.0.0.0 Microsoft.PowerShell.Security Cmdlet Get-Alias 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-AuthenticodeSignature 7.0.0.0 Microsoft.PowerShell.Security Cmdlet Get-ChildItem 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Get-Clipboard 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Get-CmsMessage 7.0.0.0 Microsoft.PowerShell.Security Cmdlet Get-Command 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Get-ComputerInfo 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Get-ComputerRestorePoint 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Get-Content 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Get-ControlPanelItem 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Get-Counter 7.0.0.0 Microsoft.PowerShell.Diagnostics Cmdlet Get-Credential 7.0.0.0 Microsoft.PowerShell.Security Cmdlet Get-Culture 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-Date 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-Error 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-Event 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-EventLog 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Get-EventSubscriber 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-ExecutionPolicy 7.0.0.0 Microsoft.PowerShell.Security Cmdlet Get-ExperimentalFeature 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Get-FileHash 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-FormatData 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-Help 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Get-History 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Get-Host 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-HotFix 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Get-InstalledPSResource 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet Get-Item 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Get-ItemProperty 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Get-ItemPropertyValue 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Get-Job 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Get-LocalGroup 1.0.0.0 Microsoft.PowerShell.LocalAccounts Cmdlet Get-LocalGroupMember 1.0.0.0 Microsoft.PowerShell.LocalAccounts Cmdlet Get-LocalUser 1.0.0.0 Microsoft.PowerShell.LocalAccounts Cmdlet Get-Location 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Get-MarkdownOption 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-Member 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-Module 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Get-PfxCertificate 7.0.0.0 Microsoft.PowerShell.Security Cmdlet Get-Process 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Get-PSBreakpoint 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-PSCallStack 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-PSDrive 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Get-PSHostProcessInfo 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Get-PSProvider 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Get-PSResourceRepository 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet Get-PSScriptFileInfo 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet Get-PSSession 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Get-PSSessionCapability 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Get-PSSessionConfiguration 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Get-PSSubsystem 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Get-Random 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-Runspace 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-RunspaceDebug 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-SecureRandom 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-Service 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Get-TimeZone 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Get-TraceSource 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-Transaction 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Get-TypeData 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-UICulture 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-Unique 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-Uptime 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-Variable 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-Verb 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Get-WinEvent 7.0.0.0 Microsoft.PowerShell.Diagnostics Cmdlet Get-WmiObject 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Group-Object 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Import-Alias 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Import-Clixml 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Import-Counter 3.0.0.0 Microsoft.PowerShell.Diagnostics Cmdlet Import-Csv 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Import-LocalizedData 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Import-Module 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Import-PowerShellDataFile 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Import-PSSession 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Install-PSResource 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet Invoke-Command 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Invoke-Expression 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Invoke-History 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Invoke-Item 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Invoke-RestMethod 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Invoke-WebRequest 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Invoke-WmiMethod 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Join-Path 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Join-String 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Limit-EventLog 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Measure-Command 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Measure-Object 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Move-Item 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Move-ItemProperty 7.0.0.0 Microsoft.PowerShell.Management Cmdlet New-Alias 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet New-Event 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet New-EventLog 3.1.0.0 Microsoft.PowerShell.Management Cmdlet New-FileCatalog 7.0.0.0 Microsoft.PowerShell.Security Cmdlet New-Guid 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet New-Item 7.0.0.0 Microsoft.PowerShell.Management Cmdlet New-ItemProperty 7.0.0.0 Microsoft.PowerShell.Management Cmdlet New-LocalGroup 1.0.0.0 Microsoft.PowerShell.LocalAccounts Cmdlet New-LocalUser 1.0.0.0 Microsoft.PowerShell.LocalAccounts Cmdlet New-Module 7.6.0.4 Microsoft.PowerShell.Core Cmdlet New-ModuleManifest 7.6.0.4 Microsoft.PowerShell.Core Cmdlet New-Object 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet New-PSDrive 7.0.0.0 Microsoft.PowerShell.Management Cmdlet New-PSRoleCapabilityFile 7.6.0.4 Microsoft.PowerShell.Core Cmdlet New-PSScriptFileInfo 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet New-PSSession 7.6.0.4 Microsoft.PowerShell.Core Cmdlet New-PSSessionConfigurationFile 7.6.0.4 Microsoft.PowerShell.Core Cmdlet New-PSSessionOption 7.6.0.4 Microsoft.PowerShell.Core Cmdlet New-PSTransportOption 7.6.0.4 Microsoft.PowerShell.Core Cmdlet New-Service 7.0.0.0 Microsoft.PowerShell.Management Cmdlet New-TemporaryFile 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet New-TimeSpan 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet New-Variable 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet New-WebServiceProxy 3.1.0.0 Microsoft.PowerShell.Management Cmdlet New-WinEvent 7.0.0.0 Microsoft.PowerShell.Diagnostics Cmdlet Out-Default 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Out-File 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Out-GridView 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Out-Host 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Out-Null 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Out-Printer 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Out-String 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Pop-Location 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Protect-CmsMessage 7.0.0.0 Microsoft.PowerShell.Security Cmdlet Publish-PSResource 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet Push-Location 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Read-Host 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Receive-Job 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Receive-PSSession 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Register-ArgumentCompleter 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Register-EngineEvent 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Register-ObjectEvent 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Register-PSResourceRepository 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet Register-PSSessionConfiguration 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Register-WmiEvent 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Remove-Alias 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Remove-Computer 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Remove-Event 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Remove-EventLog 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Remove-Item 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Remove-ItemProperty 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Remove-Job 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Remove-LocalGroup 1.0.0.0 Microsoft.PowerShell.LocalAccounts Cmdlet Remove-LocalGroupMember 1.0.0.0 Microsoft.PowerShell.LocalAccounts Cmdlet Remove-LocalUser 1.0.0.0 Microsoft.PowerShell.LocalAccounts Cmdlet Remove-Module 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Remove-PSBreakpoint 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Remove-PSDrive 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Remove-PSSession 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Remove-Service 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Remove-TypeData 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Remove-Variable 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Remove-WmiObject 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Rename-Computer 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Rename-Item 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Rename-ItemProperty 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Rename-LocalGroup 1.0.0.0 Microsoft.PowerShell.LocalAccounts Cmdlet Rename-LocalUser 1.0.0.0 Microsoft.PowerShell.LocalAccounts Cmdlet Reset-ComputerMachinePassword 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Resolve-Path 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Restart-Computer 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Restart-Service 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Restore-Computer 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Resume-Service 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Save-Help 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Save-PSResource 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet Select-Object 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Select-String 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Select-Xml 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Send-MailMessage 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Set-Acl 7.0.0.0 Microsoft.PowerShell.Security Cmdlet Set-Alias 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Set-AuthenticodeSignature 7.0.0.0 Microsoft.PowerShell.Security Cmdlet Set-Clipboard 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Set-Content 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Set-Date 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Set-ExecutionPolicy 7.0.0.0 Microsoft.PowerShell.Security Cmdlet Set-Item 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Set-ItemProperty 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Set-LocalGroup 1.0.0.0 Microsoft.PowerShell.LocalAccounts Cmdlet Set-LocalUser 1.0.0.0 Microsoft.PowerShell.LocalAccounts Cmdlet Set-Location 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Set-MarkdownOption 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Set-PSBreakpoint 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Set-PSDebug 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Set-PSResourceRepository 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet Set-PSSessionConfiguration 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Set-Service 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Set-StrictMode 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Set-TimeZone 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Set-TraceSource 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Set-Variable 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Set-WmiInstance 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Show-Command 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Show-ControlPanelItem 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Show-EventLog 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Show-Markdown 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Sort-Object 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Split-Path 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Start-Job 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Start-Process 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Start-Service 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Start-Sleep 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Start-ThreadJob 2.2.0 Microsoft.PowerShell.ThreadJob Cmdlet Start-Transaction 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Start-Transcript 7.0.0.0 Microsoft.PowerShell.Host Cmdlet Stop-Computer 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Stop-Job 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Stop-Process 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Stop-Service 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Stop-Transcript 7.0.0.0 Microsoft.PowerShell.Host Cmdlet Suspend-Service 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Tee-Object 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Test-ComputerSecureChannel 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Test-Connection 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Test-FileCatalog 7.0.0.0 Microsoft.PowerShell.Security Cmdlet Test-Json 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Test-ModuleManifest 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Test-Path 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Test-PSScriptFileInfo 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet Test-PSSessionConfigurationFile 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Trace-Command 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Unblock-File 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Undo-Transaction 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Uninstall-PSResource 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet Unprotect-CmsMessage 7.0.0.0 Microsoft.PowerShell.Security Cmdlet Unregister-Event 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Unregister-PSResourceRepository 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet Unregister-PSSessionConfiguration 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Update-FormatData 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Update-Help 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Update-List 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Update-PSModuleManifest 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet Update-PSResource 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet Update-PSScriptFileInfo 1.1.1 Microsoft.PowerShell.PSResourceGet Cmdlet Update-TypeData 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Use-Transaction 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Wait-Debugger 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Wait-Event 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Wait-Job 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Wait-Process 7.0.0.0 Microsoft.PowerShell.Management Cmdlet Where-Object 7.6.0.4 Microsoft.PowerShell.Core Cmdlet Write-Debug 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Write-Error 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Write-EventLog 3.1.0.0 Microsoft.PowerShell.Management Cmdlet Write-Host 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Write-Information 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Write-Output 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Write-Progress 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Write-Verbose 7.0.0.0 Microsoft.PowerShell.Utility Cmdlet Write-Warning 7.0.0.0 Microsoft.PowerShell.Utility这些命令分别是什么意思
06-22
那你继续加油吧 你看看我是选Y还是关掉窗口重新开始 还是怎么办?PS C:\Users\Administrator> function Set-CurlVersion { >> [CmdletBinding()] >> param( >> [Parameter(Mandatory=$true)] >> [ValidateSet("custom", "system")] >> [string]$Version >> ) >> >> $platform = Get-Platform >> $currentPath = $env:Path -split [System.IO.Path]::PathSeparator >> >> # 创建系统路径变量 >> $systemPath = if ($platform -eq "Windows") { >> Join-Path -Path $env:SystemRoot -ChildPath "System32" >> } else { >> $null >> } >> >> switch ($Version) { >> "custom" { >> # 添加自定义路径到临时环境变量 >> $newPath = @($script:CurlPath) >> $newPath += $currentPath | Where-Object { >> $_ -ne $systemPath -and >> $_ -ne "/usr/bin" -and >> $_ -ne "/usr/local/bin" >> } >> } >> "system" { >> # 恢复原始环境变量 >> $newPath = $currentPath | Where-Object { $_ -ne $script:CurlPath } >> } >> } >> >> # 更新环境变量 >> $env:Path = $newPath -join [System.IO.Path]::PathSeparator >> Write-Host "已切换到 curl $Version 版本" -ForegroundColor Green >> } >> PS C:\Users\Administrator> # 创建模块目录 >> $moduleDir = "$env:USERPROFILE\Documents\WindowsPowerShell\Modules\CurlTools" >> New-Item -ItemType Directory -Path $moduleDir -Force | Out-Null >> >> # 创建模块文件 >> $modulePath = Join-Path $moduleDir "CurlTools.psm1" >> PS C:\Users\Administrator> $manifestContent = @' >> @{ >> ModuleVersion = '1.0.0' >> RootModule = 'CurlTools.psm1' >> Author = 'Your Name' >> Description = '高级curl工具集模块' >> FunctionsToExport = @( >> 'Get-CurlVersion', >> 'Set-CurlVersion', >> 'Invoke-SecureDownload', >> 'Get-FileHashFromUrl', >> 'Update-CurlToolsModule' >> ) >> CompatiblePSEditions = @('Desktop', 'Core') >> PowerShellVersion = '5.1' >> } >> '@ >> >> Set-Content -Path (Join-Path $moduleDir "CurlTools.psd1") -Value $manifestContent >> PS C:\Users\Administrator> # 完整的模块内容(已修复所有错误) >> $moduleContent = @' >> # CurlTools.psm1 >> # ============== >> # 模块主文件 >> >> # 初始化模块变量 >> $script:Config = $null >> $script:CurlPath = $null >> $script:ConfigDir = $null >> $script:ConfigPath = $null >> >> # 检测操作系统 >> function Get-Platform { >> if ($PSVersionTable.PSEdition -eq "Core") { >> if ($IsWindows) { return "Windows" } >> elseif ($IsLinux) { return "Linux" } >> elseif ($IsMacOS) { return "macOS" } >> } else { >> return "Windows" >> } >> } >> >> # 获取跨平台配置目录 >> function Get-ConfigDir { >> $platform = Get-Platform >> switch ($platform) { >> "Linux" { >> if (-not (Test-Path "$env:HOME/.config")) { >> New-Item -ItemType Directory -Path "$env:HOME/.config" -Force | Out-Null >> } >> return "$env:HOME/.config/curltools" >> } >> "macOS" { >> if (-not (Test-Path "$env:HOME/Library/Application Support")) { >> New-Item -ItemType Directory -Path "$env:HOME/Library/Application Support" -Force | Out-Null >> } >> return "$env:HOME/Library/Application Support/CurlTools" >> } >> default { >> if (-not (Test-Path $env:APPDATA)) { >> New-Item -ItemType Directory -Path $env:APPDATA -Force | Out-Null >> } >> return "$env:APPDATA\CurlTools" >> } >> } >> } >> >> # 获取跨平台curl路径 >> function Get-DefaultCurlPath { >> $platform = Get-Platform >> switch ($platform) { >> "Linux" { return "/usr/bin" } >> "macOS" { return "/usr/local/bin" } >> default { >> # 尝试自动检测Windows上的curl路径 >> $potentialPaths = @( >> "C:\Program Files\curl\bin", >> "C:\curl\bin", >> "$env:USERPROFILE\curl\bin", >> "E:\curl-8.15.0_4-win64-mingw\bin" >> ) >> >> foreach ($path in $potentialPaths) { >> $curlExe = Join-Path $path "curl.exe" >> if (Test-Path $curlExe -PathType Leaf) { >> return $path >> } >> } >> >> # 使用默认路径 >> return "E:\curl-8.15.0_4-win64-mingw\bin" >> } >> } >> } >> >> # 初始化模块配置 >> function Initialize-ModuleConfig { >> $script:ConfigDir = Get-ConfigDir >> >> # 确保配置目录存在 >> if (-not (Test-Path $script:ConfigDir)) { >> New-Item -ItemType Directory -Path $script:ConfigDir -Force | Out-Null >> } >> >> $script:ConfigPath = Join-Path -Path $script:ConfigDir -ChildPath "config.json" >> >> # 加载或创建默认配置 >> if (Test-Path $script:ConfigPath) { >> try { >> $script:Config = Get-Content $script:ConfigPath | ConvertFrom-Json >> } catch { >> Write-Warning "配置加载失败: $_,创建新配置" >> $script:Config = $null >> } >> } >> >> if (-not $script:Config) { >> $script:Config = [PSCustomObject]@{ >> CurlPath = Get-DefaultCurlPath >> LastUpdate = (Get-Date).ToString("o") >> AutoUpdate = $true >> } >> $script:Config | ConvertTo-Json | Set-Content $script:ConfigPath -Force >> } >> >> # 设置模块路径 >> $script:CurlPath = $script:Config.CurlPath >> } >> >> # 保存配置 >> function Save-ModuleConfig { >> $script:Config | ConvertTo-Json | Set-Content $script:ConfigPath -Force >> } >> >> # 在模块导入时自动初始化配置 >> Initialize-ModuleConfig >> >> # 获取文件哈希 >> function Get-FileHashFromUrl { >> <# >> .SYNOPSIS >> 从URL获取文件的哈希值 >> >> .DESCRIPTION >> 下载文件到临时位置并计算其哈希值 >> >> .PARAMETER Url >> 要下载的文件URL >> >> .PARAMETER Algorithm >> 哈希算法 (SHA256, SHA1, MD5等) >> >> .EXAMPLE >> Get-FileHashFromUrl -Url "https://example.com/file.zip" -Algorithm SHA256 >> #> >> param( >> [Parameter(Mandatory=$true)] >> [string]$Url, >> >> [ValidateSet("SHA1", "SHA256", "SHA384", "SHA512", "MD5")] >> [string]$Algorithm = "SHA256" >> ) >> >> $tempFile = [System.IO.Path]::GetTempFileName() >> try { >> Write-Verbose "下载文件以计算哈希: $Url" >> $curlPath = Join-Path $script:CurlPath "curl.exe" >> & $curlPath -L -s -o $tempFile $Url >> >> if (-not (Test-Path $tempFile -PathType Leaf)) { >> throw "文件下载失败" >> } >> >> $hash = (Get-FileHash -Path $tempFile -Algorithm $Algorithm).Hash >> Write-Verbose "$Algorithm 哈希值: $hash" >> return $hash >> } catch { >> Write-Error "获取文件哈希失败: $_" >> return $null >> } finally { >> Remove-Item $tempFile -Force -ErrorAction SilentlyContinue >> } >> } >> >> # 获取curl版本信息 >> function Get-CurlVersion { >> <# >> .SYNOPSIS >> 获取已安装和最新的curl版本信息 >> >> .DESCRIPTION >> 返回包含已安装版本、最新版本和更新命令的对象 >> >> .EXAMPLE >> Get-CurlVersion >> #> >> # 获取已安装版本 >> try { >> $curlPath = Join-Path $script:CurlPath "curl.exe" >> $versionOutput = & $curlPath --version 2>&1 | Out-String >> if (-not ($versionOutput -match 'curl (\d+\.\d+\.\d+)')) { >> throw "无法解析 curl 版本信息" >> } >> $installedVersion = $Matches[1] >> } catch { >> Write-Warning "获取已安装版本失败: $_" >> $installedVersion = "0.0.0" >> } >> >> # 获取最新版本 >> try { >> $latestVersion = $null >> >> # 方案1: 使用官方下载页面解析 >> try { >> $curlPath = Join-Path $script:CurlPath "curl.exe" >> $releasePage = & $curlPath -s -L https://curl.se/download.html >> if ($releasePage -match 'curl (\d+\.\d+\.\d+)</a> is the latest') { >> $latestVersion = $Matches[1] >> } >> } catch { >> Write-Verbose "官方下载页面解析失败: $_" >> } >> >> # 方案2: 使用 GitHub API >> if (-not $latestVersion) { >> try { >> $headers = @{ >> "User-Agent" = "PowerShell-CurlTools" >> "Accept" = "application/vnd.github.v3+json" >> } >> $curlPath = Join-Path $script:CurlPath "curl.exe" >> $releaseInfo = & $curlPath -s -L -H $headers https://api.github.com/repos/curl/curl/releases/latest >> $json = $releaseInfo | ConvertFrom-Json >> $latestVersion = $json.tag_name -replace 'curl-', '' -replace '_', '.' >> } catch { >> Write-Verbose "GitHub API 请求失败: $_" >> } >> } >> >> # 方案3: 从curl.haxx.se获取版本 >> if (-not $latestVersion) { >> try { >> $curlPath = Join-PPath $script:CurlPath "curl.exe" >> $versionPage = & $curlPath -s -L https://curl.haxx.se/info >> if ($versionPage -match 'curl (\d+\.\d+\.\d+)') { >> $latestVersion = $Matches[1] >> } >> } catch { >> Write-Verbose "curl.haxx.se 请求失败: $_" >> } >> } >> >> if (-not $latestVersion) { >> throw "无法获取最新版本" >> } >> } catch { >> Write-Warning "获取最新版本失败: $_" >> $latestVersion = $installedVersion >> } >> >> return [PSCustomObject]@{ >> Installed = $installedVersion >> Latest = $latestVersion >> UpdateCmd = "winget install curl.curl" >> } >> } >> >> # 切换curl版本 >> function Set-CurlVersion { >> <# >> .SYNOPSIS >> 切换使用的curl版本 >> >> .DESCRIPTION >> 在自定义版本和系统版本之间切换 >> >> .PARAMETER Version >> 要切换的版本 (custom 或 system) >> >> .EXAMPLE >> Set-CurlVersion -Version custom >> #> >> [CmdletBinding()] >> param( >> [Parameter(Mandatory=$true)] >> [ValidateSet("custom", "system")] >> [string]$Version >> ) >> >> $platform = Get-Platform >> $currentPath = $env:Path -split [System.IO.Path]::PathSeparator >> >> # 创建系统路径变量 >> $systemPath = if ($platform -eq "Windows") { >> Join-Path -Path $env:SystemRoot -ChildPath "System32" >> } else { >> $null >> } >> >> switch ($Version) { >> "custom" { >> # 添加自定义路径到临时环境变量 >> $newPath = @($script:CurlPath) >> $newPath += $currentPath | Where-Object { >> $_ -ne $systemPath -and >> $_ -ne "/usr/bin" -and >> $_ -ne "/usr/local/bin" >> } >> } >> "system" { >> # 恢复原始环境变量 >> $newPath = $currentPath | Where-Object { $_ -ne $script:CurlPath } >> } >> } >> >> # 更新环境变量 >> $env:Path = $newPath -join [System.IO.Path]::PathSeparator >> Write-Host "已切换到 curl $Version 版本" -ForegroundColor Green >> } >> >> # 安全下载文件 >> function Invoke-SecureDownload { >> <# >> .SYNOPSIS >> 安全下载文件并验证哈希值 >> >> .DESCRIPTION >> 下载文件并验证其哈希值以确保完整性 >> >> .PARAMETER Url >> 要下载的文件URL >> >> .PARAMETER ExpectedHash >> 期望的哈希值(可选) >> >> .PARAMETER Algorithm >> 哈希算法 (默认: SHA256) >> >> .PARAMETER OutputPath >> 输出文件路径 >> >> .PARAMETER AutoVerify >> 自动从源获取哈希值 >> >> .EXAMPLE >> Invoke-SecureDownload -Url "https://example.com/file.zip" -AutoVerify >> #> >> [CmdletBinding()] >> param( >> [Parameter(Mandatory=$true)] >> [string]$Url, >> >> [string]$ExpectedHash, >> >> [ValidateSet("SHA1", "SHA256", "SHA384", "SHA512", "MD5")] >> [string]$Algorithm = "SHA256", >> >> [string]$OutputPath = (Split-Path -Leaf $Url), >> >> [switch]$AutoVerify >> ) >> >> try { >> # 创建下载目录 >> $downloadDir = Split-Path -Path $OutputPath -Parent >> if (-not [string]::IsNullOrEmpty($downloadDir) -and -not (Test-Path $downloadDir)) { >> New-Item -ItemType Directory -Path $downloadDir -Force | Out-Null >> } >> >> # 下载文件 >> Write-Host "下载文件: $Url" -ForegroundColor Cyan >> $curlPath = Join-Path $script:CurlPath "curl.exe" >> & $curlPath -L -o $OutputPath -C - $Url >> >> # 自动获取哈希值(如果需要) >> if ($AutoVerify -or (-not $ExpectedHash)) { >> $ExpectedHash = Get-FileHashFromUrl -Url $Url -Algorithm $Algorithm >> if (-not $ExpectedHash) { >> throw "无法获取远程文件的$Algorithm哈希值" >> } >> Write-Host "自动获取哈希值: $ExpectedHash" -ForegroundColor Yellow >> } >> >> # 验证哈希 >> $actualHash = (Get-FileHash -Path $OutputPath -Algorithm $Algorithm).Hash >> >> if ($actualHash -ne $ExpectedHash) { >> Remove-Item $OutputPath -Force >> throw "文件哈希验证失败! 期望: $ExpectedHash, 实际: $actualHash" >> } >> >> Write-Host "✅ 文件验证成功: $OutputPath" -ForegroundColor Green >> return $OutputPath >> } catch { >> Write-Error "下载失败: $_" >> return $null >> } >> } >> >> # 模块更新函数 >> function Update-CurlToolsModule { >> <# >> .SYNOPSIS >> 更新CurlTools模块到最新版本 >> >> .DESCRIPTION >> 从GitHub仓库下载最新版本的模块文件 >> >> .EXAMPLE >> Update-CurlToolsModule >> #> >> try { >> $updateUrl = "https://raw.githubusercontent.com/yourname/curltools/main/CurlTools.psm1" >> >> # 获取模块路径 >> $moduleDir = if ($PSVersionTable.PSEdition -eq "Core") { >> "$env:USERPROFILE\Documents\PowerShell\Modules\CurlTools" >> } else { >> "$env:USERPROFILE\Documents\WindowsPowerShell\Modules\CurlTools" >> } >> >> $modulePath = Join-Path -Path $moduleDir -ChildPath "CurlTools.psm1" >> >> # 创建备份 >> $backupPath = "$modulePath.bak" >> if (Test-Path $modulePath) { >> Copy-Item -Path $modulePath -Destination $backupPath -Force >> } >> >> # 下载更新 >> Write-Host "下载模块更新..." -ForegroundColor Cyan >> $curlPath = Join-Path $script:CurlPath "curl.exe" >> & $curlPath -L -o $modulePath $updateUrl >> >> # 重新加载模块 >> Remove-Module CurlTools -ErrorAction SilentlyContinue >> Import-Module $modulePath -Force >> >> # 更新配置 >> $script:Config.LastUpdate = (Get-Date).ToString("o") >> Save-ModuleConfig >> >> Write-Host "✅ 模块已成功更新至最新版本" -ForegroundColor Green >> return $true >> } catch { >> # 恢复备份 >> if (Test-Path $backupPath) { >> Copy-Item -Path $backupPath -Destination $modulePath -Force >> Remove-Item $backupPath -Force >> } >> >> Write-Error "模块更新失败: $_" >> return $false >> } >> } >> >> # 导出模块成员 >> Export-ModuleMember -Function Get-CurlVersion, Set-CurlVersion, Invoke-SecureDownload, Get-FileHashFromUrl, Update-CurlToolsModule >> '@ >> >> Set-Content -Path $modulePath -Value $moduleContent -Force >> PS C:\Users\Administrator> # 创建模块目录 >> $moduleDir = "$env:USERPROFILE\Documents\WindowsPowerShell\Modules\CurlTools" >> New-Item -ItemType Directory -Path $moduleDir -Force >> >> # 创建模块清单 >> $manifestContent = @" >> @{ >> ModuleVersion = '1.0.0' >> RootModule = 'CurlTools.psm1' >> Author = 'Your Name' >> Description = '高级curl工具集模块' >> FunctionsToExport = @( >> 'Get-CurlVersion', >> 'Set-CurlVersion', >> 'Invoke-SecureDownload', >> 'Get-FileHashFromUrl', >> 'Update-CurlToolsModule' >> ) >> CompatiblePSEditions = @('Desktop', 'Core') >> PowerShellVersion = '5.1' >> } >> "@ >> Set-Content -Path "$moduleDir\CurlTools.psd1" -Value $manifestContent >> >> # 创建模块文件 >> $modulePath = "$moduleDir\CurlTools.psm1" >> # 使用上面完整的模块内容填充此文件 >> 目录: C:\Users\Administrator\Documents\WindowsPowerShell\Modules Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2025/8/12 19:05 CurlTools PS C:\Users\Administrator> # 导入模块 >> Import-Module CurlTools -Force >> >> # 获取curl版本信息 >> $versionInfo = Get-CurlVersion >> Write-Host "当前版本: $($versionInfo.Installed)" >> Write-Host "最新版本: $($versionInfo.Latest)" >> >> # 安全下载文件(自动验证哈希) >> $downloadedFile = Invoke-SecureDownload -Url "https://example.com/file.zip" -AutoVerify >> >> # 切换curl版本 >> Set-CurlVersion -Version custom >> >> # 更新模块 >> Update-CurlToolsModule >> 警告: 获取已安装版本失败: 无法将参数绑定到参数“Path”,因为该参数是空值。 警告: 获取最新版本失败: 无法获取最新版本 当前版本: 0.0.0 最新版本: 0.0.0 下载文件: https://example.com/file.zip Invoke-SecureDownload : 下载失败: 无法将参数绑定到参数“Path”,因为该参数是空值。 所在位置 行:10 字符: 19 + ... oadedFile = Invoke-SecureDownload -Url "https://example.com/file.zip" ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Invoke-SecureDownload 已切换到 curl custom 版本 下载模块更新... Update-CurlToolsModule : 模块更新失败: 无法将参数绑定到参数“Path”,因为该参数是空值。 所在位置 行:16 字符: 1 + Update-CurlToolsModule + ~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Update-CurlToolsModule False PS C:\Users\Administrator> # 检查模块是否加载 >> Get-Module -Name CurlTools >> >> # 查看导出的函数 >> (Get-Module CurlTools).ExportedCommands.Keys >> >> # 查看模块路径 >> (Get-Module CurlTools).Path >> ModuleType Version Name ExportedCommands ---------- ------- ---- ---------------- Script 1.0.0 CurlTools {Get-CurlVersion, Get-FileHashFromUrl, Invoke-SecureDownlo... Get-CurlVersion Get-FileHashFromUrl Invoke-SecureDownload Set-CurlVersion Update-CurlToolsModule C:\Users\Administrator\Documents\WindowsPowerShell\Modules\CurlTools\CurlTools.psm1 PS C:\Users\Administrator> # 设置调试模式 >> Set-PSDebug -Trace 2 >> >> # 运行函数 >> Get-CurlVersion >> >> # 关闭调试 >> Set-PSDebug -Off >> 调试: 5+ >>>> Get-CurlVersion 调试: 165+ function Get-CurlVersion >>>> { 调试: ! CALL function 'Get-CurlVersion' (defined in file 'C:\Users\Administrator\Documents\WindowsPowerShell\Modules\CurlTools\CurlTools.psm1') 调试: 178+ >>>> $curlPath = Join-Path $script:CurlPath "curl.exe" 调试: 185+ >>>> Write-Warning "获取已安装版本失败: $_" 警告: 获取已安装版本失败: 无法将参数绑定到参数“Path”,因为该参数是空值。 调试: 186+ >>>> $installedVersion = "0.0.0" 调试: ! SET $installedVersion = '0.0.0'. 调试: 191+ >>>> $latestVersion = $null 调试: ! SET $latestVersion = ''. 调试: 195+ >>>> $curlPath = Join-Path $script:CurlPath "curl.exe" 调试: 201+ >>>> Write-Verbose "官方下载页面解析失败: $_" 调试: 205+ if ( >>>> -not $latestVersion) { 调试: 207+ >>>> $headers = @{ 调试: ! SET $headers = 'System.Collections.Hashtable'. 调试: 211+ >>>> $curlPath = Join-Path $script:CurlPath "curl.exe" 调试: 216+ >>>> Write-Verbose "GitHub API 请求失败: $_" 调试: 221+ if ( >>>> -not $latestVersion) { 调试: 223+ >>>> $curlPath = Join-PPath $script:CurlPath "curl.exe" 调试: 229+ >>>> Write-Verbose "curl.haxx.se 请求失败: $_" 调试: 233+ if ( >>>> -not $latestVersion) { 调试: 234+ >>>> throw "无法获取最新版本" 调试: 237+ >>>> Write-Warning "获取最新版本失败: $_" 警告: 获取最新版本失败: 无法获取最新版本 调试: 238+ >>>> $latestVersion = $installedVersion 调试: ! SET $latestVersion = '0.0.0'. 调试: 241+ return >>>> [PSCustomObject]@{ 调试: 246+ >>>> } 调试: 8+ >>>> Set-PSDebug -Off Installed Latest UpdateCmd --------- ------ --------- 0.0.0 0.0.0 winget install curl.curl PS C:\Users\Administrator> # 在函数开头添加错误处理 >> function Get-CurlVersion { >> [CmdletBinding()] >> param() >> >> try { >> # 函数主体 >> } >> catch { >> Write-Error "Get-CurlVersion 失败: $_" >> Write-Error "详细信息: $($_.ScriptStackTrace)" >> return $null >> } >> } >> PS C:\Users\Administrator> # 创建自签名证书 >> $cert = New-SelfSignedCertificate -Type CodeSigning -Subject "CN=CurlTools" -KeyUsage DigitalSignature >> >> # 签名模块 >> Set-AuthenticodeSignature -FilePath $modulePath -Certificate $cert >> 目录: C:\Users\Administrator\Documents\WindowsPowerShell\Modules\CurlTools SignerCertificate Status Path ----------------- ------ ---- 96719E43A5BBD9F7A6394A6FE0A4686AEF7667FC UnknownError CurlTools.psm1 PS C:\Users\Administrator> # Tests/Get-CurlVersion.Tests.ps1 >> Describe "Get-CurlVersion" { >> It "返回有效的版本对象" { >> $result = Get-CurlVersion >> $result | Should -Not -Be $null >> $result.Installed | Should -Match '^\d+\.\d+\.\d+$' >> $result.Latest | Should -Match '^\d+\.\d+\.\d+$' >> } >> } >> Describing Get-CurlVersion [-] 返回有效的版本对象 180ms RuntimeException: '-Not' is not a valid Should operator. 在 Get-TestResult、C:\Program Files\WindowsPowerShell\Modules\Pester\3.4.0\Functions\Assertions\Should.ps1 中: 第 42 行 在 Should<End>、C:\Program Files\WindowsPowerShell\Modules\Pester\3.4.0\Functions\Assertions\Should.ps1 中: 第 83 行 在 <ScriptBlock>、<无文件> 中: 第 5 行 在 Invoke-Test、C:\Program Files\WindowsPowerShell\Modules\Pester\3.4.0\Functions\It.ps1 中: 第 253 行 在 ItImpl、C:\Program Files\WindowsPowerShell\Modules\Pester\3.4.0\Functions\It.ps1 中: 第 203 行 在 It、C:\Program Files\WindowsPowerShell\Modules\Pester\3.4.0\Functions\It.ps1 中: 第 117 行 在 <ScriptBlock>、<无文件> 中: 第 3 行 在 Describe、C:\Program Files\WindowsPowerShell\Modules\Pester\3.4.0\Functions\Describe.ps1 中: 第 100 行 在 <ScriptBlock>、<无文件> 中: 第 2 行 PS C:\Users\Administrator> # 安装 PlatyPS >> Install-Module -Name PlatyPS -Force >> >> # 生成帮助文档 >> New-MarkdownHelp -Module CurlTools -OutputFolder docs >> 需要使用 NuGet 提供程序来继续操作 PowerShellGet 需要使用 NuGet 提供程序“2.8.5.201”或更高版本来与基于 NuGet 的存储库交互。必须在“C:\Program Files\PackageManagement\ProviderAssemblies”或“C:\Users\Administrator\AppData\Local\PackageManagement\ProviderAssembli es”中提供 NuGet 提供程序。也可以通过运行 'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force' 安装 NuGet 提供程序。是否要让 PowerShellGet 立即安装并导入 NuGet 提供程序? [Y] 是(Y) [N] 否(N) [S] 暂停(S) [?] 帮助 (默认值为“Y”):
08-13
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值