zoukankan      html  css  js  c++  java
  • import-module in $profile

    $PROFILE

    C:UserscluDocumentsPowerShellMicrosoft.PowerShell_profile.ps1


    Import-Module 'C:Usersclusource eposGitHubOtherposh-gitsrcposh-git.psd1'
    Import-Module 'C:Usersclusource eposGitHubOtherPowerShelluild.psm1'
    #Import-Module "C:Usersclusource eposGitHubOtherPowerShellsrcModulesWindowsMicrosoft.PowerShell.ManagementMicrosoft.PowerShell.Management.psd1"
    Import-Module 'C:Usersclusource eposGitHubChuckLuScriptsPowershellchuck.psm1'
    #Import-Module "C:Usersclusource eposGitHubOtherPowerShellGetPowerShellGet"
    #Import-Module "C:Usersclusource eposGitHubOtherPowerShellGetPowerShellGetprivatefunctionsGet-PSGalleryApiAvailability.ps1"
    Import-WinModule Microsoft.PowerShell.Management

    前置命令,需要安装

    https://github.com/PowerShell/WindowsCompatibility  来确保可以使用Remove-EventLog

    Install-Module WindowsCompatibility -Scope CurrentUser

    然后才可以Import-WinModule Microsoft.PowerShell.Management

    https://github.com/PowerShell/WindowsCompatibility/issues/73#issuecomment-655565655

    In PowerShell 7, you should no longer need the WindowsCompatibility module. Instead try Import-Module -UseWindowsPowerShell <module>

    PS C:Usersclusource eposNLogTestNLogTestinDebug> Import-WinModule Microsoft.PowerShell.Management
    New-PSSession: C:UserscluDocumentsPowerShellModulesWindowsCompatibility1.0.0WindowsCompatibility.psm1:232
    Line |
     232 |          $session = New-PSSession @newPSSessionParameters | Select-Obj …
         |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         | [localhost] Connecting to remote server localhost failed with the following error message : The client
         | cannot connect to the destination specified in the request. Verify that the service on the destination
         | is running and is accepting requests. Consult the logs and documentation for the WS-Management service
         | running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run
         | the following command on the destination to analyze and configure the WinRM service: "winrm
         | quickconfig". For more information, see the about_Remote_Troubleshooting Help topic.

  • 相关阅读:
    简单协议解析
    三刺激值
    74hc595
    色彩理论
    灰度值和强度值概念
    RGB 常用颜色对照表
    IAR注释的快捷键
    visual studio 2015 2017 key vs2015 vs2017密钥
    如何在cmd命令行中查看、修改、删除与添加环境变量
    win cmd 设置代理
  • 原文地址:https://www.cnblogs.com/chucklu/p/9705243.html
Copyright © 2011-2022 走看看