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"})

MKServerBuilder.psm1的更多相关文章

  1. MKServerBuilder.psd1

    MKServerBuilder.psd1 # # Module manifest for module 'MKServerBuilder' # # Generated by: Edward Guan ...

  2. Restart-ServiceEx.psm1

    详细描述 利用WMI的Win32_Service类重启指定计算机上的服务. Restart-ServiceEx cmdlet 通过WMI的Win32_Service类向指定计算机(ComputerNa ...

  3. Code First 迁移,及迁移错误

    迁移错误: 今天在使用EF6 Code First时,出现如下错误,折腾了老半天.分享一下,帮后面的兄弟少走弯路. PM> Enable-Migrations Checking if the c ...

  4. EntityFramework 7 开发纪录

    博文目录: 暂时开发模式 Code First 具体体现 DbContext 配置 Entity 映射关联配置 Migration 问题纪录(已解决) 之前的一篇博文:EF7 Code First O ...

  5. powershell脚本,命令行参数传值,并绑定变量的例子

    这是小技巧文章,所以文章不长.但原创唯一,非常重要.我搜了下,还真没有人发 powershell怎样 [命令行 参数 绑定],所以我决定写成博客. 搜索关键字如下: powershell 命令行 参数 ...

  6. 【转】PowerShell入门(十一):编写脚本模块

    转至:http://www.cnblogs.com/ceachy/archive/2013/03/08/PowerShell_Script_Module.html 现在通过编写模块就可以在PowerS ...

  7. 使用powershell提权的一些技巧

    原文:http://fuzzysecurity.com/tutorials/16.html 翻译:http://www.myexception.cn/windows/1752546.html http ...

  8. Import-Module ServerManager Import-Module : 未能加载指定的模块“ServerManager”,因为在任何模块目录中都没有找到有效模块文件...(通过Setup Factory调用PowerShell的脚本)

    操作系统: Windows server 2008 R2(64位) C:\Windows\System32\WindowsPowerShell\v1.0\Modules 下有ServerManager ...

  9. 下载和使用 Open XML PowerTools

    安装 Open XML SDK 2.5 首先,需要安装 Open XML SDK 2.5 ,从这个地址下载安装程序:http://www.microsoft.com/en-in/download/de ...

随机推荐

  1. 使用eclipse开发webService很简单

    原文转自:http://blog.csdn.net/guo_rui22/article/details/6253745 使用Eclipse生成一个WebService应用 1.创建一个Dynamic ...

  2. Android ViewDragHelper源码解析

    在自定义ViewGroup的过程中,如果涉及到View的拖动滑动,ViewDragHelper的使用应该是少不了的,它提供了一系列用于用户拖动子View的辅助方法和相关的状态记录,像Navigatio ...

  3. Android ListView异步加载数据

    1.主Activity public class MainActivity extends Activity { private ListView listView; private ArrayLis ...

  4. DIV 清除样式浮动万能代码

            .talk {             width: 100%;             margin: 10px 0;         }         .talk:after { ...

  5. 【HDOJ】2206 IP的计算

    题目很简单,情况有很多种. #include <stdio.h> #include <string.h> ]; int isIPaddr(char buf[]) { int i ...

  6. SharePoint用户控件编写的简单介绍

    转:http://www.it165.net/design/html/201204/1131.html 我们开发中,通常需要写各种各样的部件来实现我们的展示或者功能,下面就介绍下刚刚接触的QuickP ...

  7. format 对整形的应用

    对于整型数,会在整型值的前面以0补之 Format('this is %.7d'[1234]);             输出是:this is 0001234]

  8. 基于MyEclipse+9.0+++Tomcat+7.0的SSH+平台搭建

    基于MyEclipse+9.0+++Tomcat+7.0的SSH+平台搭建 http://wenku.baidu.com/view/96fbfe0f581b6bd97f19ea1d.html 用MyE ...

  9. [转]web调试工具总结(firebug/fidder/httpwatch/wireshark)

    ONE:Firebug: Firebug是网页浏览器 Mozilla Firefox下的一款开发类插件, 现属于Firefox的五星级强力推荐插件之一.它集HTML查看和编辑.Javascript控制 ...

  10. Ubuntu---2

    1.Ubuntu学习笔记之:安装中文语言包 http://askubuntu.com/questions/59356/how-do-i-get-chinese-input-to-work