随笔分类 - PowerShell
摘要:1 下载安装Emacs windows版本
2 下载el文件和配置Emacs加载PowerShell
3 体验用Emacs来执行和编辑PowerShell脚本
阅读全文
摘要:我在访问ps1文件的时候,一定要注意访问路径中是否包含空格。包含空格要用单引号''来处理。PowerShell -command Set-ExecutionPolicy "Bypass"set filepath= '%CD%\AppDeployment.ps1'PowerShell -command "& %filepath%"Pause错误的写法:PS C:\> C:\Documents and Settings\Mingle\My Documents\PS\test.ps1The term 'C:
阅读全文
摘要:View Code 1 Add-PSSnapin Microsoft.SharePoint.PowerShell -EA SilentlyContinue 2 $serviceApplicationPool="Secure Store Service Pool" #name of the application pool under which the application should run 3 $secureStoreDatabaseName="GMAxSecureStoreServiceDB" #the sharepoint database
阅读全文
摘要:<Users><Name>$user</Name><Gender>Male</Gender></Users>View Code # D:\Services\ 指定要递归遍历查找的目录 # *.config 找查找的文件名 $fileList = Get-ChildItem 'F:\temp\test\' -recurse *.xml | %{$_.FullName}$baishi = {$user}Foreach($file in $fileList){ # $tmpXML = [xml](Get-Cont
阅读全文
摘要:Get-Help Set-Variable -Param Scope-scope <string>Specifies the scope from which aliases should be exported. This can be a named scope: "global", "local", or "script", or it can be a number relative to the current scope (0 through the number of scopes where 0 is th
阅读全文
摘要:搭建环境:Win7和Win2008中自带有PowerShell 2.0,在命令中输入powershell即可。http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=20430使用Windows PowerShell ISE编写代码,用户体验跟写c#代码很像。在运行命令中输入powershell_ise,即可。第三方开发工具:PowerGUI.3.1.0.2058.msi,提供智能感知功能。常用快捷键:保存ps文件后可以按F9启动调试F10跳跃调试F11单步调试get-command *uninstall
阅读全文