[运维笔记] PowerShell (模块).模块的查找、安装、卸载、更新、保存、发布
作者主页:jcLee95:https://blog.csdn.net/qq_28550263?spm=3001.5343
本文地址:https://blog.csdn.net/qq_28550263/article/details/121239402?spm=1001.2014.3001.5501
0. 相关命令速查表
包管理相关命令
命令 | 功能 |
---|---|
Find-Package | 在可用的软件包源中查找软件包。 |
Find-PackageProvider | 返回可用于安装的包管理包提供程序列表。 |
Get-Package | 返回使用PackageManagement安装的所有软件包的列表。 |
Get-PackageProvider | 返回连接到包管理的包提供程序列表。 |
Get-PackageSource | 获取为包提供程序注册的包源列表。 |
Import-PackageProvider | 将包管理包提供程序添加到当前会话。 |
Install-Package | 安装一个或多个软件包。 |
Install-PackageProvider | 安装一个或多个包管理包提供程序。 |
Register-PackageSource | 为指定的包提供程序添加包源。 |
Save-Package | 将包保存到本地计算机,而不安装它们。 |
Set-PackageSource | 替换指定包提供程序的包源。 |
Uninstall-Package | 卸载一个或多个软件包。 |
Unregister-PackageSource | 移除注册的包源。 |
包获取
命令 | 功能 |
---|---|
Find-Command | 在模块中查找PowerShell命令。 |
Find-DscResource | 查找所需的状态配置资源。 |
Find-Module | 在存储库中查找符合指定条件的模块。 |
Find-RoleCapability | 在存储库中查找符合指定条件的模块。 |
Find-Script | 查找一个脚本 |
Get-InstalledModule | 获取计算机上由PowerShellGet安装的模块列表。 |
Get-InstalledScript | 获取已安装的脚本。 |
Get-PSRepository | 获取PowerShell存储库。 |
Install-Module | 从存储库中下载一个或多个模块,并将其安装在本地计算机上。 |
Install-Script | 安装脚本。 |
New-ScriptFileInfo | 使用元数据创建脚本文件。 |
Publish-Module | 将指定模块从本地计算机发布到在线库。 |
Publish-Script | 发布脚本。 |
Register-PSRepository | 注册PowerShell存储库。 |
Save-Module | 将模块及其依赖项保存在本地计算机上,但不安装该模块。 |
Save-Script | 保存脚本。 |
Set-PSRepository | 为注册的存储库设置值。 |
Test-ScriptFileInfo | 验证脚本的注释块。 |
Uninstall-Module | 卸载模块。 |
Uninstall-Script | 卸载脚本。 |
Unregister-PSRepository | 注销存储库。 |
Update-Module | 将指定模块的最新版本从在线库下载并安装到本地计算机。 |
Update-ModuleManifest | 更新模块清单文件。 |
Update-Script | 更新脚本。 |
Update-ScriptFileInfo | 更新脚本的信息。 |
1. 查找 PowerShell 库(模块)
模块是一个独立的可重用单元,允许对 PowerShell 代码进行分隔、组织和抽象化。 模块可以包含一个或多个模块成员,它们是命令(如 cmdlet 和函数)和项(如变量和别名)。 这些成员的名称可以专用于模块,也可以被导出到导入了模块的会话中。—— powershell doc
在PowerShell中模块分为清单、脚本和二进制模块三种类型:
- 清单模块是一个包含模块信息的文件,它控制该模块使用的特定方面;
- 脚本模块是一个 PowerShell 脚本文件,其文件扩展名为
.psm1
;- 二进制模块包含用于定义 cmdlet 和提供程序的类类型。 与脚本模块不同,二进制模块是以编译语言编写(如C、C#)的。二进制模块是一个 .NET 程序集(即 DLL),它是针对 PowerShell 库编译的。
1.1 在 PSGallery 主页中查找
微软为PowerShell提供了一个中央存储库,地址为https://www.powershellgallery.com/。这就与 Python 的 Pypi、Nodejs 的 npm 为其对应的语言提供的中央存储仓库类似:
通过在该网站的搜索框中搜索,你可以找到一些相关的库资源。
1.2 使用 Find-Module
命令查找库(模块)
1.2.1 命令功能与语法
该命令用于在存储库中查找符合指定条件的模块,其语法格式如下:
Find-Module[[-Name] <string[]>][-MinimumVersion <string>][-MaximumVersion <string>][-RequiredVersion <string>][-AllVersions][-IncludeDependencies][-Filter <string>][-Tag <string[]>][-Includes <string[]>][-DscResource <string[]>][-RoleCapability <string[]>][-Command <string[]>][-Proxy <uri>][-ProxyCredential <pscredential>][-Repository <string[]>][-Credential <pscredential>][-AllowPrerelease][<CommonParameters>]
1.2.2 参数含义
- AllowPrerelease
:包括标记为预发布的结果模块。
类型: | SwitchParameter |
---|---|
Position: | Named |
默认值: | None |
接收管道输入: | False |
接受通配符: | False |
-AllVersions
:指定在结果中包含模块的所有版本。您不能使用具有最小反转、最大反转或所需反转参数的全反转参数。
类型: | SwitchParameter |
---|---|
Position: | Named |
默认值: | None |
接收管道输入: | False |
接受通配符: | False |
-Command
:指定在模块中查找的命令阵列。命令可以是一个函数或工作流。
类型: | String[] |
---|---|
Position: | Named |
默认值: | None |
接收管道输入: | False |
接受通配符: | False |
-Credential
指定有权为指定的包提供商或源安装模块的用户帐户。
类型: | PSCredential |
---|---|
Position: | Named |
默认值: | None |
接收管道输入: | True |
接受通配符: | False |
-DscResource
指定包含 DSC 资源的模块的名称或名称的一部分。根据 PowerShell 惯例,当您提供多个参数时,执行或搜索。
类型: | String[] |
---|---|
Position: | Named |
默认值: | None |
接收管道输入: | False |
接受通配符: | False |
-Filter
:根据包管理提供商特定的搜索语法指定筛选器。对于 NuGet 模块,此参数相当于使用PSGallery网站上的搜索栏进行搜索。
类型: | String |
---|---|
Position: | Named |
默认值: | None |
接收管道输入: | False |
接受通配符: | False |
-IncludeDependencies
:表示此操作包括所有依赖于名称参数中指定的模块的模块。
类型: | SwitchParameter |
---|---|
Position: | Named |
默认值: | None |
接收管道输入: | False |
接受通配符: | False |
- Includes
:仅返回包含特定类型的电源壳功能的模块。例如,您可能只想查找包含DscResource模块。
类型: | String[] |
---|---|
可以接受的参数: | DscResource, Cmdlet, Function, RoleCapability |
Position: | Named |
默认值: | None |
接收管道输入: | False |
接受通配符: | False |
-MaximumVersion
:指定模块的最大版本或最新版本,以包含在搜索结果中。最大反转和必需反转不能在同一命令中使用。
类型: | String |
---|---|
Position: | Named |
默认值: | None |
接收管道输入: | True |
接受通配符: | False |
-MinimumVersion
:指定模块的最低版本以包含在结果中。不能在同一命令中使用最小反转和必需的转用。
类型: | String |
---|---|
Position: | Named |
默认值: | None |
接收管道输入: | True |
接受通配符: | False |
-Name
:指定要在存储库中搜索的模块的名称。接受模块名称的逗号分离列表。通配符被接受。
类型: | String[] |
---|---|
Position: | 0 |
默认值: | None |
接收管道输入: | True |
接受通配符: | False |
-Proxy
:指定请求的代理服务器,而不是直接连接到 Internet 资源。
类型: | Uri |
---|---|
Position: | Named |
默认值: | None |
接收管道输入: | True |
接受通配符: | False |
-ProxyCredential
指定有权使用代理参数指定的代理服务器的用户帐户。
类型: | PSCredential |
---|---|
Position: | Named |
默认值: | None |
接收管道输入: | True |
接受通配符: | False |
-Repository
使用存储库参数指定用于搜索模块的存储库。注册多个存储库时使用。接受一个逗号分离的存储库列表。要注册存储库,请使用 。要显示注册的存储库,请使用 。Register-PSRepository``Get-PSRepository
类型: | String[] |
---|---|
Position: | Named |
默认值: | None |
接收管道输入: | False |
接受通配符: | False |
-RequiredVersion
指定模块的确切版本编号以包含在结果中。所需的反转不能在相同的命令中使用为最小反转或最大反转。
类型: | String |
---|---|
Position: | Named |
默认值: | None |
接收管道输入: | True |
接受通配符: | False |
-RoleCapability
指定一系列角色功能。
类型: | String[] |
---|---|
Position: | Named |
默认值: | None |
接收管道输入: | False |
接受通配符: | False |
-Tag
指定一系列标签。示例标签包括 DesiredStateConfiguration, DSC, DSCResourceKit,,或者 PSModule.
类型: | String[] |
---|---|
Position: | Named |
默认值: | None |
接收管道输入: | False |
接受通配符: | False |
2. 安装 PowerShell 库
2.1 安装 PowerShell 模块是做什么
创建 PowerShell 模块后,你可能需要在系统上安装该模块,以便你或其他人可以使用它。一个PowerShell模块的模块文件包括.psm1
或二进制程序集
、模块清单(.psd1
文件)和任何其他相关文件。比如以下是一个名为logger
的模块:
而安装模块的过程包括将模块文件复制到该计算机的目录中。
2.2 为什么需要 安装 模块
安装模块是为了能够导入这些安装好的模块,模块在本文也称作库。导入就像Python等语言中的import
那样。你在使用Python进行编程时,通常使用pip
包管理工具为Python安装各种第三方模块,在不创建使用Python“虚拟隔离环境”时,这些模块被安装在Python包目录中的“side-packdges”目录下,这样只要你使用的是该Python运行环境,你便可以在系统任何位置的脚本直接导入这些包。 PowerShell与此类似。
2.3 模块安装到哪里去
2.3.1 PSModulePath 环境变量
简介
Cmdlet 需要根据PSModulePath 环境变量的值来查找模块,这不像Python会从默认的"Lib\site-packages"开始查找,因为你也可以自己指定该环境变量的值。这包括为供自己使用而创建的模块、从其他方获取的模块以及分发给其他人的模块。因此,你需要尽可能将所有模块安装在 PSModulePath 环境变量中列出的路径中。
2.3.2 如何查看当前的 PSModulePath 环境变量
值
【方法1】
$Env:PSModulePath
执行效果如图:
【方法2】
[Environment]::GetEnvironmentVariable("PSModulePath")
执行效果如图:
默认情况下,PSModulePath 环境变量值包含以下系统和用户模块目录(但你可以对此值进行添加和编辑):
alias | 备注 | |
---|---|---|
$PSHome\Modules
|
%Windir%\System32\WindowsPowerShell\v1.0\Modules
|
此位置专门用于 Windows 附带的模块。 请勿将模块安装到此位置。 |
$Home\Documents\WindowsPowerShell\Modules
|
%UserProfile%\Documents\WindowsPowerShell\Modules
|
- |
$Env:ProgramFiles\WindowsPowerShell\Modules
|
%ProgramFiles%\WindowsPowerShell\Modules
|
- |
【方法3】
你也可以用过Get-ChildItem Env:
命令查看所有的环境变量,当然这种查看方式在这里没有单独查看“PSModulePath”环境变量的$Env:PSModulePath
或者[Environment]::GetEnvironmentVariable("PSModulePath")
直接。
Get-ChildItem Env:
2.3.3 增改 PSModulePath 环境变量
条目
# 获取PSModulePath 到变量 $p
$p = [Environment]::GetEnvironmentVariable("PSModulePath")# 对变量 $p 直接生猛地拼接字符串就好了,因为它就是字符串。
# 每增加一条时需要使用英文的分号(“;”)隔开。
$p += ";C:\Program Files (x86)\MyCompany\Modules\"# 然后将更改后的变量值重新设置为 PSModulePath 环境变量即可:
[Environment]::SetEnvironmentVariable("PSModulePath",$p)
其中SetEnvironmentVariable
命令用于设置环境变量。
2.3.4 默认安装位置
在仅仅指定模块名时,默认安装位置为PSModulePath 环境变量
中的第一条记录所指向的位置。比如,我的电脑上第一条为C:\Users\李俊才\Documents\PowerShell\Modules;
,执行以下安装:
Install-Module -Name Logger
打开该目录,如图:
可以看到Logger
和它的一个名为ColoredText
的依赖模块都被安装到了此目录下。
当然,我们没有必要手动打开该目录进行查询已经安装好的模块,PowerShell为我们提供了Get-InstalledModule
命令,其语法格式如下:
Get-InstalledModule[[-Name] <String[]>][-MinimumVersion <String>][-RequiredVersion <String>][-MaximumVersion <String>][-AllVersions][-AllowPrerelease][<CommonParameters>]
其参数如解释下:
-AllowPrerelease
包括在标记为预发布的结果模块中。
类型: | SwitchParameter |
---|---|
Position: | Named |
默认值: | None |
接受管道输入 : | False |
接受通配符 | False |
-AllVersions
指示您想要获取模块的所有可用版本。你不能使用 带有 MinimumVersion, MaximumVersion,或者 RequiredVersion 参数的AllVersions 参数。
类型: | SwitchParameter |
---|---|
Position: | Named |
默认值: | None |
接受管道输入 : | False |
接受通配符 | False |
-MaximumVersion
指定要获取的模块的最大版本或最新版本。 MaximumVersion 和 RequiredVersion 参数是互斥的;不能在同一命令中同时使用这两个参数。
类型: | String |
---|---|
Position: | Named |
默认值 : | None |
接受管道输入 : | True |
接受通配符 | False |
-MinimumVersion
指定要获取的单个模块的最低版本。 MinimumVersion 和 RequiredVersion 参数是互斥的;不能在同一命令中同时使用这两个参数。
类型: | String |
---|---|
Position: | Named |
默认值 : | None |
接受管道输入 : | True |
接受通配符 | False |
-Name
指定要获取的模块名称数组。
类型: | String[] |
---|---|
Position: | 0 |
默认值 : | None |
接受管道输入 : | True |
接受通配符 | False |
-RequiredVersion
指定要获取的模块的确切版本。
类型: | String |
---|---|
Position: | Named |
默认值 : | None |
接受管道输入: | True |
接受通配符 | False |
【例子1】:查询本地已经安装的模块
运行结果如图所示:
需要注意这上面的模块时用户安装到的PSModulePath对应目录的模块,而并非系统上安装的所有PowerShell模块。要查看系统上安装的所有模块,需要使用Get-Module -ListAvailable
命令。
【例子2】
Get-Module -ListAvailable
Out[]:
Directory: C:\Users\李俊才\Documents\PowerShell\ModulesModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 1.0.6 ColoredText Desk {Format-Color, cprint}
Script 1.0.7 Logger DeskDirectory: C:\program files\powershell\7\ModulesModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Manifest 7.0.0.0 CimCmdlets Core {Get-CimAssociatedInstance, Get-CimClass, Get-CimInstance, Get-CimSession…}
Manifest 1.2.5 Microsoft.PowerShell.Archive Desk {Compress-Archive, Expand-Archive}
Manifest 7.0.0.0 Microsoft.PowerShell.Diagnostics Core {Get-WinEvent, New-WinEvent, Get-Counter}
Manifest 7.0.0.0 Microsoft.PowerShell.Host Core {Start-Transcript, Stop-Transcript}
Manifest 7.0.0.0 Microsoft.PowerShell.Management Core {Add-Content, Clear-Content, Get-Clipboard, Set-Clipboard…}
Manifest 7.0.0.0 Microsoft.PowerShell.Security Core {Get-Acl, Set-Acl, Get-PfxCertificate, Get-Credential…}
Manifest 7.0.0.0 Microsoft.PowerShell.Utility Core {Export-Alias, Get-Alias, Import-Alias, New-Alias…}
Manifest 7.0.0.0 Microsoft.WSMan.Management Core {Disable-WSManCredSSP, Enable-WSManCredSSP, Get-WSManCredSSP, Set-WSManQuickConfig…}
Script 1.4.7 PackageManagement Desk {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource…}
Script 2.2.5 PowerShellGet Desk {Find-Command, Find-DSCResource, Find-Module, Find-RoleCapability…}
Script 2.0.5 PSDesiredStateConfiguration Core {Configuration, New-DscChecksum, Get-DscResource, Invoke-DscResource}
Script 7.0.0.0 PSDiagnostics Core {Disable-PSTrace, Disable-PSWSManCombinedTrace, Disable-WSManTrace, Enable-PSTrace…}
Script 2.1.0 PSReadLine Desk {Get-PSReadLineKeyHandler, Set-PSReadLineKeyHandler, Remove-PSReadLineKeyHandler, Get-PSReadLineOption…}
Binary 2.0.3 ThreadJob Desk Start-ThreadJobDirectory: C:\Program Files\WindowsPowerShell\ModulesModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Script 5.1.2 Azure Desk {Get-AzureAutomationCertificate, Get-AzureAutomationConnection, New-AzureAutomationConnection, Remove-AzureAutomationConnection…}
Manifest 0.5.0 Azure.AnalysisServices Desk {Add-AzureAnalysisServicesAccount, Restart-AzureAnalysisServicesInstance, Export-AzureAnalysisServicesInstanceLog, Sync-AzureAnalysisServicesInstance}
Script 4.2.1 Azure.Storage Desk {Get-AzureStorageTable, New-AzureStorageTableSASToken, New-AzureStorageTableStoredAccessPolicy, New-AzureStorageTable…}
Script 5.7.0 AzureRM Desk
Script 0.6.6 AzureRM.AnalysisServices Desk {Resume-AzureRmAnalysisServicesServer, Suspend-AzureRmAnalysisServicesServer, Get-AzureRmAnalysisServicesServer, Remove-AzureRmAnalysisServicesServer…}
Script 5.1.2 AzureRM.ApiManagement Desk {Add-AzureRmApiManagementRegion, Get-AzureRmApiManagementSsoToken, New-AzureRmApiManagementHostnameConfiguration, New-AzureRmApiManagementRegion…}
Script 0.1.3 AzureRM.ApplicationInsights Desk {Get-AzureRmApplicationInsights, New-AzureRmApplicationInsights, Remove-AzureRmApplicationInsights, Set-AzureRmApplicationInsightsPricingPlan…}
Script 4.3.2 AzureRM.Automation Desk {Get-AzureRMAutomationHybridWorkerGroup, Get-AzureRmAutomationJobOutputRecord, Import-AzureRmAutomationDscNodeConfiguration, Export-AzureRmAutomationDscConfiguration…}
Script 4.0.4 AzureRM.Backup Desk {Backup-AzureRmBackupItem, Enable-AzureRmBackupContainerReregistration, Get-AzureRmBackupContainer, Register-AzureRmBackupContainer…}
Script 4.0.6 AzureRM.Batch Desk {Remove-AzureRmBatchAccount, Get-AzureRmBatchAccount, Get-AzureRmBatchAccountKeys, New-AzureRmBatchAccount…}
Script 0.14.1 AzureRM.Billing Desk {Get-AzureRmBillingInvoice, Get-AzureRmBillingPeriod, Get-AzureRmEnrollmentAccount}
Script 4.2.2 AzureRM.Cdn Desk {Get-AzureRmCdnProfile, Get-AzureRmCdnProfileSsoUrl, New-AzureRmCdnProfile, Remove-AzureRmCdnProfile…}
Script 0.9.4 AzureRM.CognitiveServices Desk {Get-AzureRmCognitiveServicesAccount, Get-AzureRmCognitiveServicesAccountKey, Get-AzureRmCognitiveServicesAccountSkus, Get-AzureRmCognitiveServicesAccountUsage…}
Script 4.6.0 AzureRM.Compute Desk {Remove-AzureRmAvailabilitySet, Get-AzureRmAvailabilitySet, New-AzureRmAvailabilitySet, Update-AzureRmAvailabilitySet…}
Script 0.3.1 AzureRM.Consumption Desk Get-AzureRmConsumptionUsageDetail
Script 0.2.5 AzureRM.ContainerInstance Desk {New-AzureRmContainerGroup, Get-AzureRmContainerGroup, Remove-AzureRmContainerGroup, Get-AzureRmContainerInstanceLog}
Script 1.0.4 AzureRM.ContainerRegistry Desk {New-AzureRmContainerRegistry, Get-AzureRmContainerRegistry, Update-AzureRmContainerRegistry, Remove-AzureRmContainerRegistry…}
Script 4.2.2 AzureRM.DataFactories Desk {Remove-AzureRmDataFactory, Get-AzureRmDataFactoryRun, Get-AzureRmDataFactorySlice, Save-AzureRmDataFactoryLog…}
Script 0.5.3 AzureRM.DataFactoryV2 Desk {Set-AzureRmDataFactoryV2, Update-AzureRmDataFactoryV2, Get-AzureRmDataFactoryV2, Remove-AzureRmDataFactoryV2…}
Script 4.2.3 AzureRM.DataLakeAnalytics Desk {Get-AzureRmDataLakeAnalyticsDataSource, New-AzureRmDataLakeAnalyticsCatalogCredential, Remove-AzureRmDataLakeAnalyticsCatalogCredential, Remove-AzureRmDataLakeAnalyticsCatalogSecret…}
Script 5.2.0 AzureRM.DataLakeStore Desk {Get-AzureRmDataLakeStoreTrustedIdProvider, Remove-AzureRmDataLakeStoreTrustedIdProvider, Remove-AzureRmDataLakeStoreFirewallRule, Set-AzureRmDataLakeStoreTrustedIdProvider…}
Script 4.0.4 AzureRM.DevTestLabs Desk {Get-AzureRmDtlAllowedVMSizesPolicy, Get-AzureRmDtlAutoShutdownPolicy, Get-AzureRmDtlAutoStartPolicy, Get-AzureRmDtlVMsPerLabPolicy…}
Script 4.1.2 AzureRM.Dns Desk {Get-AzureRmDnsRecordSet, New-AzureRmDnsRecordConfig, Remove-AzureRmDnsRecordSet, Set-AzureRmDnsRecordSet…}
Script 0.3.2 AzureRM.EventGrid Desk {New-AzureRmEventGridTopic, Get-AzureRmEventGridTopic, Set-AzureRmEventGridTopic, New-AzureRmEventGridTopicKey…}
Script 0.6.3 AzureRM.EventHub Desk {New-AzureRmEventHubNamespace, Get-AzureRmEventHubNamespace, Set-AzureRmEventHubNamespace, Remove-AzureRmEventHubNamespace…}
Script 4.1.2 AzureRM.HDInsight Desk {Get-AzureRmHDInsightJob, New-AzureRmHDInsightSqoopJobDefinition, Wait-AzureRmHDInsightJob, New-AzureRmHDInsightStreamingMapReduceJobDefinition…}
Script 4.0.4 AzureRM.Insights Desk {Get-AzureRmMetricDefinition, Get-AzureRmMetric, Remove-AzureRmLogProfile, Get-AzureRmLogProfile…}
Script 3.1.2 AzureRM.IotHub Desk {Add-AzureRmIotHubKey, Get-AzureRmIotHubEventHubConsumerGroup, Get-AzureRmIotHubConnectionString, Get-AzureRmIotHubJob…}
Script 4.3.0 AzureRM.KeyVault Desk {Add-AzureKeyVaultCertificate, Set-AzureKeyVaultCertificateAttribute, Stop-AzureKeyVaultCertificateOperation, Get-AzureKeyVaultCertificateOperation…}
Script 4.0.3 AzureRM.LogicApp Desk {Get-AzureRmIntegrationAccountAgreement, Get-AzureRmIntegrationAccountCallbackUrl, Get-AzureRmIntegrationAccountCertificate, Get-AzureRmIntegrationAccount…}
Script 0.17.2 AzureRM.MachineLearning Desk {Move-AzureRmMlCommitmentAssociation, Get-AzureRmMlCommitmentAssociation, Get-AzureRmMlCommitmentPlanUsageHistory, Remove-AzureRmMlCommitmentPlan…}
Script 0.4.2 AzureRM.MachineLearningCompute Desk {Get-AzureRmMlOpCluster, Get-AzureRmMlOpClusterKey, Test-AzureRmMlOpClusterSystemServicesUpdateAvailability, Update-AzureRmMlOpClusterSystemService…}
Script 0.2.1 AzureRM.MarketplaceOrdering Desk {Get-AzureRmMarketplaceTerms, Set-AzureRmMarketplaceTerms}
Script 0.9.2 AzureRM.Media Desk {Sync-AzureRmMediaServiceStorageKeys, Set-AzureRmMediaServiceKey, Get-AzureRmMediaServiceKeys, Get-AzureRmMediaServiceNameAvailability…}
Script 5.4.2 AzureRM.Network Desk {Add-AzureRmApplicationGatewayAuthenticationCertificate, Get-AzureRmApplicationGatewayAuthenticationCertificate, New-AzureRmApplicationGatewayAuthenticationCertificate, Remove-AzureRmApplicationGatewayAuthenticationCertificate…}
Script 4.1.1 AzureRM.NotificationHubs Desk {Get-AzureRmNotificationHub, Get-AzureRmNotificationHubAuthorizationRules, Get-AzureRmNotificationHubListKeys, Get-AzureRmNotificationHubPNSCredentials…}
Script 4.3.2 AzureRM.OperationalInsights Desk {New-AzureRmOperationalInsightsAzureActivityLogDataSource, New-AzureRmOperationalInsightsCustomLogDataSource, Disable-AzureRmOperationalInsightsLinuxCustomLogCollection, Disable-AzureRmOperationalInsightsIISLogCollection…}
Script 4.1.4 AzureRM.PowerBIEmbedded Desk {Remove-AzureRmPowerBIWorkspaceCollection, Get-AzureRmPowerBIWorkspaceCollection, Get-AzureRmPowerBIWorkspaceCollectionAccessKeys, Get-AzureRmPowerBIWorkspace…}
Script 4.6.0 AzureRM.Profile Desk {Disable-AzureRmDataCollection, Disable-AzureRmContextAutosave, Enable-AzureRmDataCollection, Enable-AzureRmContextAutosave…}
Script 4.1.2 AzureRM.RecoveryServices Desk {Get-AzureRmRecoveryServicesBackupProperty, Get-AzureRmRecoveryServicesVault, Get-AzureRmRecoveryServicesVaultSettingsFile, New-AzureRmRecoveryServicesVault…}
Script 4.1.2 AzureRM.RecoveryServices.Backup Desk {Backup-AzureRmRecoveryServicesBackupItem, Get-AzureRmRecoveryServicesBackupManagementServer, Get-AzureRmRecoveryServicesBackupContainer, Unregister-AzureRmRecoveryServicesBackupContainer…}
Script 0.2.4 AzureRM.RecoveryServices.SiteRecov… Desk {Edit-AzureRmRecoveryServicesAsrRecoveryPlan, Get-AzureRmRecoveryServicesAsrAlertSetting, Get-AzureRmRecoveryServicesAsrEvent, Get-AzureRmRecoveryServicesAsrFabric…}
Script 4.1.2 AzureRM.RedisCache Desk {Remove-AzureRmRedisCachePatchSchedule, New-AzureRmRedisCacheScheduleEntry, Get-AzureRmRedisCachePatchSchedule, New-AzureRmRedisCachePatchSchedule…}
Script 0.3.3 AzureRM.Relay Desk {New-AzureRmRelayNamespace, Get-AzureRmRelayNamespace, Set-AzureRmRelayNamespace, Remove-AzureRmRelayNamespace…}
Script 5.5.2 AzureRM.Resources Desk {Get-AzureRmProviderOperation, Remove-AzureRmRoleAssignment, Get-AzureRmRoleAssignment, New-AzureRmRoleAssignment…}
Script 0.16.3 AzureRM.Scheduler Desk {Disable-AzureRmSchedulerJobCollection, Enable-AzureRmSchedulerJobCollection, Get-AzureRmSchedulerJobCollection, Get-AzureRmSchedulerJob…}
Script 4.1.2 AzureRM.ServerManagement Desk {Invoke-AzureRmServerManagementPowerShellCommand, Get-AzureRmServerManagementSession, New-AzureRmServerManagementSession, Remove-AzureRmServerManagementSession…}
Script 0.6.4 AzureRM.ServiceBus Desk {New-AzureRmServiceBusNamespace, Get-AzureRmServiceBusNamespace, Set-AzureRmServiceBusNamespace, Remove-AzureRmServiceBusNamespace…}
Script 0.3.4 AzureRM.ServiceFabric Desk {Add-AzureRmServiceFabricApplicationCertificate, Add-AzureRmServiceFabricClientCertificate, Add-AzureRmServiceFabricClusterCertificate, Add-AzureRmServiceFabricNode…}
Script 5.0.6 AzureRM.SiteRecovery Desk {Get-AzureRmSiteRecoveryFabric, New-AzureRmSiteRecoveryFabric, Remove-AzureRmSiteRecoveryFabric, Stop-AzureRmSiteRecoveryJob…}
Script 4.4.0 AzureRM.Sql Desk {Get-AzureRmSqlDatabaseTransparentDataEncryption, Get-AzureRmSqlDatabaseTransparentDataEncryptionActivity, Set-AzureRmSqlDatabaseTransparentDataEncryption, Get-AzureRmSqlDatabaseUpgradeHint…}
Script 4.2.3 AzureRM.Storage Desk {Get-AzureRmStorageAccount, Get-AzureRmStorageAccountKey, New-AzureRmStorageAccount, New-AzureRmStorageAccountKey…}
Script 4.0.4 AzureRM.StreamAnalytics Desk {Get-AzureRmStreamAnalyticsFunction, Get-AzureRmStreamAnalyticsDefaultFunctionDefinition, New-AzureRmStreamAnalyticsFunction, Remove-AzureRmStreamAnalyticsFunction…}
Script 4.0.1 AzureRM.Tags Desk {Remove-AzureRmTag, Get-AzureRmTag, New-AzureRmTag}
Script 4.0.3 AzureRM.TrafficManager Desk {Disable-AzureRmTrafficManagerEndpoint, Enable-AzureRmTrafficManagerEndpoint, Set-AzureRmTrafficManagerEndpoint, Get-AzureRmTrafficManagerEndpoint…}
Script 4.0.2 AzureRM.UsageAggregates Desk Get-UsageAggregates
Script 4.2.2 AzureRM.Websites Desk {Get-AzureRmAppServicePlan, Set-AzureRmAppServicePlan, New-AzureRmAppServicePlan, Remove-AzureRmAppServicePlan…}
Script 1.0.1 Microsoft.PowerShell.Operation.Val… Desk {Get-OperationValidation, Invoke-OperationValidation}
Binary 1.0.0.1 PackageManagement Desk {Find-Package, Get-Package, Get-PackageProvider, Get-PackageSource…}
Script 3.4.0 Pester Desk {Describe, Context, It, Should…}
Script 1.0.0.1 PowerShellGet Desk {Install-Module, Find-Module, Save-Module, Update-Module…}
Script 2.0.0 PSReadline Desk {Get-PSReadLineKeyHandler, Set-PSReadLineKeyHandler, Remove-PSReadLineKeyHandler, Get-PSReadLineOption…}Directory: C:\WINDOWS\system32\WindowsPowerShell\v1.0\ModulesModuleType Version PreRelease Name PSEdition ExportedCommands
---------- ------- ---------- ---- --------- ----------------
Manifest 1.0.0.0 AppBackgroundTask Core,Desk {Disable-AppBackgroundTaskDiagnosticLog, Enable-AppBackgroundTaskDiagnosticLog, Set-AppBackgroundTaskResourcePolicy, Unregister-AppBackgroundTask…}
Manifest 2.0.1.0 Appx Core,Desk {Add-AppxPackage, Get-AppxPackage, Get-AppxPackageAutoUpdateSettings, Get-AppxPackageManifest…}
Script 1.0.0.0 AssignedAccess Core,Desk {Clear-AssignedAccess, Get-AssignedAccess, Set-AssignedAccess}
Manifest 1.0.0.0 BitLocker Core,Desk {Unlock-BitLocker, Suspend-BitLocker, Resume-BitLocker, Remove-BitLockerKeyProtector…}
Manifest 2.0.0.0 BitsTransfer Core,Desk {Add-BitsFile, Complete-BitsTransfer, Get-BitsTransfer, Remove-BitsTransfer…}
Manifest 1.0.0.0 BranchCache Core,Desk {Add-BCDataCacheExtension, Clear-BCCache, Disable-BC, Disable-BCDowngrading…}
Manifest 1.0.3.0 DeliveryOptimization Core,Desk {Get-DeliveryOptimizationLog, Get-DeliveryOptimizationLogAnalysis, Delete-DeliveryOptimizationCache, Disable-DeliveryOptimizationVerboseLogs…}
Manifest 1.0.0.0 DirectAccessClientComponents Core,Desk {Disable-DAManualEntryPointSelection, Enable-DAManualEntryPointSelection, Get-DAClientExperienceConfiguration, Get-DAEntryPointTableItem…}
Script 3.0 Dism Core,Desk {Add-AppProvisionedSharedPackageContainer, Add-AppxProvisionedPackage, Add-WindowsDriver, Add-WindowsCapability…}
Manifest 1.0.0.0 DnsClient Core,Desk {Resolve-DnsName, Clear-DnsClientCache, Get-DnsClient, Get-DnsClientCache…}
Manifest 1.0.0.0 EventTracingManagement Core,Desk {Start-EtwTraceSession, New-EtwTraceSession, Get-EtwTraceSession, Update-EtwTraceSession…}
Script 2021.3.23… Get-NetView Core,Desk Get-NetView
Script 1.1.0.0 IISAdministration Core,Desk
Manifest 2.1.0.0 International Core,Desk {Copy-UserInternationalSettingsToSystem, Get-WinDefaultInputMethodOverride, Set-WinDefaultInputMethodOverride, Get-WinHomeLocation…}
Manifest 1.0.0.0 Kds Core,Desk {Add-KdsRootKey, Get-KdsRootKey, Test-KdsRootKey, Set-KdsConfiguration…}
Manifest 3.0.0.0 Microsoft.PowerShell.Diagnostics Core,Desk {Get-WinEvent, Get-Counter, Import-Counter, Export-Counter…}
Manifest 1.0.0.0 Microsoft.PowerShell.LocalAccounts Core,Desk {Add-LocalGroupMember, Disable-LocalUser, Enable-LocalUser, Get-LocalGroup…}
Manifest 1.0.0 Microsoft.Windows.Bcd.Cmdlets Core,Desk {Copy-BcdEntry, Disable-BcdElementBootDebug, Disable-BcdElementBootEms, Disable-BcdElementDebug…}
Manifest 1.0 MMAgent Core,Desk {Disable-MMAgent, Enable-MMAgent, Set-MMAgent, Get-MMAgent…}
Manifest 2.0.0.0 NetAdapter Core,Desk {Disable-NetAdapter, Disable-NetAdapterBinding, Disable-NetAdapterChecksumOffload, Disable-NetAdapterEncapsulatedPacketTaskOffload…}
Manifest 1.0.0.0 NetConnection Core,Desk {Get-NetConnectionProfile, Set-NetConnectionProfile}
Manifest 1.0.0.0 NetEventPacketCapture Core,Desk {New-NetEventSession, Remove-NetEventSession, Get-NetEventSession, Set-NetEventSession…}
Manifest 2.0.0.0 NetLbfo Core,Desk {Add-NetLbfoTeamMember, Add-NetLbfoTeamNic, Get-NetLbfoTeam, Get-NetLbfoTeamMember…}
Manifest 1.0.0.0 NetNat Core,Desk {Get-NetNat, Get-NetNatExternalAddress, Get-NetNatStaticMapping, Get-NetNatSession…}
Manifest 2.0.0.0 NetQos Core,Desk {Get-NetQosPolicy, Set-NetQosPolicy, Remove-NetQosPolicy, New-NetQosPolicy}
Manifest 2.0.0.0 NetSecurity Core,Desk {Get-DAPolicyChange, New-NetIPsecAuthProposal, New-NetIPsecMainModeCryptoProposal, New-NetIPsecQuickModeCryptoProposal…}
Manifest 1.0.0.0 NetSwitchTeam Core,Desk {New-NetSwitchTeam, Remove-NetSwitchTeam, Get-NetSwitchTeam, Rename-NetSwitchTeam…}
Manifest 1.0.0.0 NetTCPIP Core,Desk {Get-NetIPAddress, Get-NetIPInterface, Get-NetIPv4Protocol, Get-NetIPv6Protocol…}
Manifest 1.0.0.0 NetworkConnectivityStatus Core,Desk {Get-DAConnectionStatus, Get-NCSIPolicyConfiguration, Reset-NCSIPolicyConfiguration, Set-NCSIPolicyConfiguration}
Manifest 1.0.0.0 NetworkSwitchManager Core,Desk {Disable-NetworkSwitchEthernetPort, Enable-NetworkSwitchEthernetPort, Get-NetworkSwitchEthernetPort, Remove-NetworkSwitchEthernetPortIPAddress…}
Manifest 1.0.0.0 NetworkTransition Core,Desk {Add-NetIPHttpsCertBinding, Disable-NetDnsTransitionConfiguration, Disable-NetIPHttpsProfile, Disable-NetNatTransitionConfiguration…}
Manifest 1.0.0.0 PcsvDevice Core,Desk {Get-PcsvDevice, Start-PcsvDevice, Stop-PcsvDevice, Restart-PcsvDevice…}
Manifest 1.0.0.0 PKI Core,Desk {Add-CertificateEnrollmentPolicyServer, Export-Certificate, Export-PfxCertificate, Get-CertificateAutoEnrollmentPolicy…}
Manifest 1.0.0.0 PnpDevice Core,Desk {Get-PnpDevice, Get-PnpDeviceProperty, Enable-PnpDevice, Disable-PnpDevice}
Manifest 1.1 PrintManagement Core,Desk {Add-Printer, Add-PrinterDriver, Add-PrinterPort, Get-PrintConfiguration…}
Binary 1.0.12 ProcessMitigations Core,Desk {Get-ProcessMitigation, Set-ProcessMitigation, ConvertTo-ProcessMitigationPolicy}
Script 3.0 Provisioning Core,Desk {Install-ProvisioningPackage, Export-ProvisioningPackage, Install-TrustedProvisioningCertificate, Export-Trace…}
Manifest 1.0.0.0 ScheduledTasks Core,Desk {Get-ScheduledTask, Set-ScheduledTask, Register-ScheduledTask, Unregister-ScheduledTask…}
Manifest 2.0.0.0 SecureBoot Core,Desk {Confirm-SecureBootUEFI, Set-SecureBootUEFI, Get-SecureBootUEFI, Format-SecureBootUEFI…}
Manifest 2.0.0.0 SmbShare Core,Desk {Get-SmbShare, Remove-SmbShare, Set-SmbShare, Block-SmbShareAccess…}
Manifest 2.0.0.0 SmbWitness Core,Desk {Get-SmbWitnessClient, Move-SmbWitnessClient, gsmbw, msmbw…}
Manifest 1.0.0.1 StartLayout Core,Desk {Export-StartLayout, Import-StartLayout, Export-StartLayoutEdgeAssets, Get-StartApps}
Manifest 2.0.0.0 Storage Core,Desk {Add-InitiatorIdToMaskingSet, Add-PartitionAccessPath, Add-PhysicalDisk, Add-StorageFaultDomain…}
Manifest 2.0.0.0 TLS Core,Desk {New-TlsSessionTicketKey, Enable-TlsSessionTicketKey, Disable-TlsSessionTicketKey, Export-TlsSessionTicketKey…}
Manifest 1.0.0.0 TroubleshootingPack Core,Desk {Get-TroubleshootingPack, Invoke-TroubleshootingPack}
Manifest 2.0.0.0 TrustedPlatformModule Core,Desk {Get-Tpm, Initialize-Tpm, Clear-Tpm, Unblock-Tpm…}
Binary 2.1.639.0 UEV Core,Desk
Manifest 2.0.0.0 VpnClient Core,Desk {Add-VpnConnection, Set-VpnConnection, Remove-VpnConnection, Get-VpnConnection…}
Manifest 1.0.0.0 Wdac Core,Desk {Get-OdbcDriver, Set-OdbcDriver, Get-OdbcDsn, Add-OdbcDsn…}
Manifest 2.0.0.0 Whea Core,Desk {Get-WheaMemoryPolicy, Set-WheaMemoryPolicy}
Manifest 1.0.0.0 WindowsDeveloperLicense Core,Desk {Get-WindowsDeveloperLicense, Unregister-WindowsDeveloperLicense, Show-WindowsDeveloperLicenseRegistration}
Script 1.0 WindowsErrorReporting Core,Desk {Enable-WindowsErrorReporting, Disable-WindowsErrorReporting, Get-WindowsErrorReporting}
Manifest 1.0.0.0 WindowsSearch Core,Desk {Get-WindowsSearchSetting, Set-WindowsSearchSetting}
Manifest 1.0.0.0 WindowsUpdate Core,Desk Get-WindowsUpdateLog
如图:
3. 卸载已安装的 PowerShell 模块
使用Uninstall-Module
命令可以卸载一个已安装的 PowerShell 模块。其语法格式如下:
Uninstall-Module[-Name] <String[]>[-MinimumVersion <String>][-RequiredVersion <String>][-MaximumVersion <String>][-AllVersions][-Force][-AllowPrerelease][-WhatIf][-Confirm][<CommonParameters>]
Uninstall-Module[-InputObject] <PSObject[]>[-Force][-WhatIf][-Confirm][<CommonParameters>]
需要注意的是,与安装模块时会自动安装模块的依赖不同,该命令仅仅会卸载指定的模块本身而不会卸载掉该模块的任何依赖模块。
参数说明
- AllowPrerelease
允许您卸载标记为预发行的模块。
类型: | SwitchParameter |
---|---|
Position: | Named |
默认值: | None |
接受管道输入: | False |
接受通配符字符: | False |
-AllVersions
指定要包含模块的所有可用版本。您不能使用具有最小反转、最大反转或所需反转参数的全反转参数。
类型: | SwitchParameter |
---|---|
Position: | Named |
默认值: | None |
接受管道输入: | False |
接受通配符字符: | False |
-Confirm
在运行之前提示进行确认 。Uninstall-Module
类型: | SwitchParameter |
---|---|
别名: | cf |
Position: | Named |
默认值: | False |
接受管道输入: | False |
接受通配符字符: | False |
-Force
无需请求用户确认即可运行的强制力。Uninstall-Module
类型: | SwitchParameter |
---|---|
Position: | Named |
默认值: | None |
接受管道输入: | False |
接受通配符字符: | False |
-InputObject
接受PS 存储信息对象。例如,输出到变量并使用该变量作为输入对象参数。Get-InstalledModule
类型: | PSObject[] |
---|---|
Position: | 0 |
默认值: | None |
接受管道输入: | False |
接受通配符字符: | False |
-MaximumVersion
指定要卸载的模块的最大版本或最新版本。。不能在同一命令中使用 MinimumVersion 和 RequiredVersion 参数。
类型: | String |
---|---|
Position: | Named |
默认值: | None |
接受管道输入: | True |
接受通配符字符: | False |
-MinimumVersion
指定卸载模块的最低版本。不能在同一命令中使用 MinimumVersion 和 RequiredVersion 参数。
类型: | String |
---|---|
Position: | Named |
默认值: | None |
接受管道输入: | True |
接受通配符字符: | False |
-Name
指定要卸载的模块名称阵列。
类型: | String[] |
---|---|
Position: | 0 |
默认值: | None |
接受管道输入: | True |
接受通配符字符: | False |
-RequiredVersion
指定要卸载的模块的确切版本编号。
类型: | String |
---|---|
Position: | Named |
默认值: | None |
接受管道输入: | True |
接受通配符字符: | False |
-WhatIf
显示如果Uninstall-Module
运行会发生什么。cmdlet没有运行。
类型: | SwitchParameter |
---|---|
别名: | wi |
Position: | Named |
默认值: | False |
接受管道输入: | False |
接受通配符字符: | False |
4. 更新 PowerShell 模块
更新 PowerShell 模块是值将指定模块的最新版本从在线模块库下载并安装到本地计算机。可以使用Update-Module
命令,其语法格式如下:
Update-Module[[-Name] <String[]>][-RequiredVersion <String>][-MaximumVersion <String>][-Credential <PSCredential>][-Scope <String>][-Proxy <Uri>][-ProxyCredential <PSCredential>][-Force][-AllowPrerelease][-AcceptLicense][-PassThru][-WhatIf][-Confirm][<CommonParameters>]
【例子1】更新所有模块
Update-Module
【例子2】由模块名更新指定模块(-Name
)
Update-Module -Name logger
【例子3】更新某个模块到指定版本(-RequiredVersion xxx
)
Update-Module -Name SpeculationControl -RequiredVersion 1.0.14
【例子4】不经过确认下更新一个模块(-Force
)
Update-Module -Name SpeculationControl -Force
5. 保存 PowerShell 模块(源码)
使用Save-Module
命令可以从存储库中下载模块及该模块的依赖保存到本地目录,但不会安装它。其语法如下:
Save-Module[-Name] <String[]>[-MinimumVersion <String>][-MaximumVersion <String>][-RequiredVersion <String>][-Repository <String[]>][-Path] <String>[-Proxy <Uri>][-ProxyCredential <PSCredential>][-Credential <PSCredential>][-Force][-AllowPrerelease][-AcceptLicense][-WhatIf][-Confirm][<CommonParameters>]
【例子1】:以名字保存某个模块及其依赖到某个目录下:
Save-Module -Name logger -Path .\modules
执行该命令后,名为“logger”的PowerShell库及其以来库被保存在在当前目录的 modules 子目录下,如图所示。
【例子2】指定模块的特定版本(该例来于官方文档)
Save-Module -Name PowerShellGet -Path C:\Test\Modules -Repository PSGallery -MaximumVersion 2.1.0
安装后,你可以在ps窗口中输出安装目录:
Get-ChildItem -Path C:\Test\Modules\PowerShellGet\
Out[]:
Directory: C:\Test\Modules\PowerShellGetMode LastWriteTime Length Name
---- ------------- ------ ----
d----- 7/1/2019 13:40 2.1.0
【例子3】查找并保存模块的特定版本(该例来于官方文档)
Find-Module -Name PowerShellGet -Repository PSGallery -RequiredVersion 1.6.5 | Save-Module -Path C:\Test\Modules
安装后,你可以在ps窗口中输出安装目录:
Get-ChildItem -Path C:\Test\Modules\PowerShellGet
Directory: C:\Test\Modules\PowerShellGetMode LastWriteTime Length Name
---- ------------- ------ ----
d----- 7/1/2019 14:04 1.6.5
6. 发布你的 PowerShell 模块
将指定模块从本地计算机发布到在 PowerShell 模块库,这样其它的开发者也包括你自己就可以通过Save-Module
、Install-Module
等命令获得你发布的模块了。想要发布你的模块需要使用Publish-Module
命令,其语法格式如下:
Publish-Module-Name <String>[-RequiredVersion <String>][-NuGetApiKey <String>][-Repository <String>][-Credential <PSCredential>][-FormatVersion <Version>][-ReleaseNotes <String[]>][-Tags <String[]>][-LicenseUri <Uri>][-IconUri <Uri>][-ProjectUri <Uri>][-Exclude <String[]>][-Force][-AllowPrerelease][-SkipAutomaticTags][-WhatIf][-Confirm][<CommonParameters>]
Publish-Module-Path <String>[-NuGetApiKey <String>][-Repository <String>][-Credential <PSCredential>][-FormatVersion <Version>][-ReleaseNotes <String[]>][-Tags <String[]>][-LicenseUri <Uri>][-IconUri <Uri>][-ProjectUri <Uri>][-Force][-SkipAutomaticTags][-WhatIf][-Confirm][<CommonParameters>]
Publish-Module
命令通过使用作为用户档案的一部分存储在图库中的API key,将模块发布到在线 NuGet-based的模块库。您可以通过模块的名称或模块的路径来指定要发布的模块。
当按名称指定模块时,Publish-Module
发布通过运行Get-Module -ListAvailable <Name>
找到的第一个模块。如果你指定要发布的模块的最低版本,Publish-Module
将发布第一个版本大于或等于你指定的最低版本的模块。
发布模块需要显示在模块库页面上的元数据。必需的元数据包括模块名称、版本、描述和作者。虽然大多数元数据取自模块清单,但一些元数据必须在发布模块参数中指定,如 Tag, ReleaseNote、IconUri、ProjectUri、 和LicenseUri,因为这些参数与基于NuGet的库中的字段匹配。
【例子】发布你的模块
Publish-Module -Name "YourModule" -NuGetApiKey "12e6d435-7fe4-3bf7-9161-5273wf36def7"
【例子2】发布模块时使用元数据
Publish-Module -Name "YourModule" -NuGetApiKey "12e6d435-7fe4-3bf7-9161-5273wf36def7" -LicenseUri "http://jcstdio.tech/license" -Tag "xxxx ","XXX" -ReleaseNote "Xxx xxx."
[运维笔记] PowerShell (模块).模块的查找、安装、卸载、更新、保存、发布相关推荐
- [运维笔记] PowerShell (模块).模块清单
[运维笔记] PowerShell (模块).模块清单 作者:jcLee95 目 录 1. 模块清单是什么 2. 如何创建模块清单 3. 模块清单.psd1文件内容解释 4. 某库的模块清单实例 1. ...
- 运维笔记10 (Linux软件的安装与管理(rpm,yum))
概述:用rpm安装和管理软件(rpm解决依赖性),用yum安装与管理软件(yum解决依赖性). 1.linux的软件 linux能够说是一款改变时代的操作系统,可是一个操作系统再优秀假设没有好用的应用 ...
- 老男孩的linux运维笔记-初级部分内容(一)
############################################################ # # USER YYYY-MM-DD – ACTION # ...
- 老男孩的运维笔记文档-中级部分(运维中级)列表(二)
############################################################ # # USER YYYY-MM-DD – ACTION # ...
- H5直播站点运维笔记一 服务器篇
H5直播站点运维笔记一 服务器 服务器篇 一.CentOS6基础操作 1. 查看服务器版本 2. 查看服务器性能 3. 文件查找 4. 软件查找 5. 用户系统 6. 远程登录工具 二.FTP ( V ...
- Nginx基础应用配置小结 - 运维笔记
Nginx基础应用配置小结 - 运维笔记 在linux系统下使用nginx作为web应用服务,用来提升网站访问速度的经验已五年多了,今天在此对nginx的使用做一简单总结. 一.nginx服务简介 N ...
- linux运维笔记:Rsync数据同步工具
linux运维笔记:Rsync数据同步工具 1-Rsync简介 Rsync英文全称是Remote synchronization,Rsync具有可以使本地和远程两台主机之间的数据快速复制和同步镜像.远 ...
- 运维笔记-nginx详解
目录 1.简介 2.正向代理与反向代理 3.nginx的安装部署(基于Centos-stream操作系统) 4.nginx配置文件详解 5.高效的Web服务器-nginx 5.1nginx服务器基本配 ...
- 运维笔记--postgresql占用CPU问题定位
运维笔记--postgresql占用CPU问题定位 场景描述: 业务系统访问变慢,登陆服务器查看系统负载并不高,然后查看占用CPU较高的进程,发现是连接数据库的几个进程占用系统资源较多. 处理方式: ...
最新文章
- 健身也内卷?这届网友用 Python 掌握了做标准俯卧撑的秘诀
- 合理配置MySQL缓存 提高缓存命中率
- git学习指南_几十张动图告诉你 Git到底是怎么玩的
- cpp 条件判断 大于等于_第31p,if条件语句,请满足我的要求
- tf model create
- python爬取toefl_spark学习进度6-Python爬取数据的四个简单实例
- java tls 实例_grpc加密TLS初体验(go、java版本)
- vue弹层时禁止页面滚动
- mini2440_x35 ubuntu下使用dnw进行传送文件
- 中国移动将于11月1日公布5G套餐价格,北京地区已建5000个5G基站
- Linux 网络命令 ip、ifconfig
- 【原创】在Windows 环境下利用SVN和Apache以及Ankh配置源代码管理服务
- 【雷达】一维和二维自适应波束形成(DBF))DBF附matlab代码
- 【Office 365 2108更新】
- android iphone 开发者选项,手机开发者选项中的妙用,让你的安卓系统流畅如iOS
- 鸿蒙系统主题如何自定义,自定义流式布局
- Linux云计算虚拟化-KVM桌面虚拟化技术
- ROS安装:一键解决人生烦恼
- 如何找自己想要的项目?看这里告诉你答案
- Windows三种文件系统:NTFS、FAT32、FAT16的区别