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.

 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.

 

$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'

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值