zoukankan      html  css  js  c++  java
  • MKServerBuilder.psm1

    MKServerBuilder.psm1

    function Test-ElevatedShell
    {
        $user = [Security.Principal.WindowsIdentity]::GetCurrent()
        (New-Object Security.Principal.WindowsPrincipal $user).IsInRole([Security.Principal.WindowsBuiltinRole]::Administrator)
    }
    
    
    if(!(Test-ElevatedShell))
    {
    
    $warning=@"
        To run commands exposed by this module on Windows Vista, Windows Server 2008, and later versions of Windows,
        you must start an elevated Windows PowerShell console. You must have Administrator privligies on the remote
        computers and the remote registry service has to be running.
    "@
    
        Write-Warning $warning    
        Exit
    }
    
    # dot-source all function files
    Get-ChildItem -Path $PSScriptRoot*.ps1 | Foreach-Object{ . $_.FullName }
    
    # Export all commands except for Test-ElevatedShell
    Export-ModuleMember –Function @(Get-Command –Module $ExecutionContext.SessionState.Module | Where-Object {$_.Name -ne "Test-ElevatedShell"})
  • 相关阅读:
    3组-Alpha冲刺-1/6
    3组 需求分析报告
    结对编程作业
    3组 团队展示
    8组-Alpha冲刺-1/6
    8组 需求分析报告
    刘凌斌 1.3
    结对编程作业
    8组 团队介绍与选题报告
    3组-Alpha冲刺-1/6
  • 原文地址:https://www.cnblogs.com/edward2013/p/3536737.html
Copyright © 2011-2022 走看看