Powershell
EriclLee
这个作者很懒,什么都没留下…
展开
-
Powershell第一步
如果在Win7中要想运行Powershell脚本或者Command,必须要用Set-ExecutionPolicy,一般来说开发用Bypass是比较合适的:Set-ExecutionPolicy -ExcutionPolicy Bypass -Force SyntaxSet-ExecutionPolicy [-ExecutionPolicy] { | | | | | | } [[-Scope] { | | | | }] [-Force] [-Confirm] [-WhatIf] []Pa原创 2011-01-21 17:10:00 · 1779 阅读 · 0 评论 -
Powershell 访问Sql数据库
一段简单的访问数据库查询数据的代码:$sqlServer = "192.168.0.1/SQLExpress" $database = "DBDemo" $saPassword = ******" $sqlConnection = New-Object System.Data.SqlClient.SqlConnection $cnnString = "Server=$sqlServer;Database=$database;User ID=sa;Password=$saPasswor原创 2011-01-24 10:53:00 · 3147 阅读 · 0 评论 -
一个很偏门的问题, C# 调用Powershell脚本,但是在Import-module的时候找不到servermanager module
一个很偏门的问题, C# 调用Powershell脚本,但是在Import-module的时候找不到servermanager module。但是如果直接执行脚本能找到该模块,而且在Module的目录下也能看到。"the specified module server manager was not loaded because no valid module was found in any module directory"这个问题我花费6个小时的时间,终于找到了问题的根源。原因是ServerManag原创 2011-02-23 20:10:00 · 4490 阅读 · 1 评论