Module in powershell

https://docs.microsoft.com/en-us/powershell/module/powershellget/install-module?view=powershell-6

 

https://docs.microsoft.com/en-us/powershell/developer/module/understanding-a-windows-powershell-module

Get-Module

https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Core/Get-Module?view=powershell-6

~\Desktop> Get-Module

ModuleType Version Name ExportedCommands
---------- ------- ---- ----------------
Manifest 6.1.0.0 Microsoft.PowerShell.Management {Add-Content, Clear-Content, Clear-Item, Clear-ItemProperty...}
Manifest 6.1.0.0 Microsoft.PowerShell.Utility {Add-Member, Add-Type, Clear-Variable, Compare-Object...}
Script 1.0.0.0 posh-git {Add-PoshGitToProfile, Expand-GitCommand, Format-GitBranchName, Get-GitBranchStatusColor...}
Script 2.0.0 PSReadLine {Get-PSReadLineKeyHandler, Get-PSReadLineOption, Remove-PSReadLineKeyHandler, Set-PSReadLineKeyHandler...}

 

Find-Module

https://docs.microsoft.com/en-us/powershell/module/PowerShellGet/Find-Module?view=powershell-6

Finds modules from an online gallery that match specified criteria.

Install-Module

https://docs.microsoft.com/en-us/powershell/module/PowerShellGet/Install-Module?view=powershell-6

Downloads one or more modules from an online gallery, and installs them on the local computer.

需要显式指定代理

Install-Module -Name WindowsCompatibility -Proxy "http://domain:port"

 

 

 Import-Module

 https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Core/Import-Module?view=powershell-6

Adds modules to the current session.

The Import-Module cmdlet adds one or more modules to the current session.

The modules that you import must be installed on the local computer or a remote computer.

 

Import-Module imports a module only into the current session.

To import the module into all sessions, add an Import-Module command to your PowerShell profile.

For more information about profiles, see about_Profiles.

 

Update-Module

  Update-Module -Name PowerShellGet -Proxy "http://domain:port" -Verbose -MaximumVersion 2.1.2 -Force

 

$PROFILE  

C:\Users\clu\Documents\PowerShell\Microsoft.PowerShell_profile.ps1

文件内容

Import-Module 'C:\Users\clu\source\repos\GitHub\Other\posh-git\src\posh-git.psd1'
Import-Module 'C:\Users\clu\source\repos\GitHub\Other\PowerShell\build.psm1'

 

作者:Chuck Lu    GitHub    
posted @   ChuckLu  阅读(979)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2017-09-06 String or binary data would be truncated. The statement has been terminated.
2017-09-06 将一个文件夹纳入library或者移除remove
2016-09-06 PowerShell 4 on win7 sp1
2016-09-06 about_Execution_Policies
2016-09-06 PowerShell常用命令
2016-09-06 Installing Chocolatey
2016-09-06 将NuGet配置到环境变量中
点击右上角即可分享
微信分享提示