Module in powershell
https://docs.microsoft.com/en-us/powershell/module/powershellget/install-module?view=powershell-6
Get-Module
~\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
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 |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.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配置到环境变量中