湖边的白杨树

探索是一种乐趣

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

随笔分类 -  Scripts

PowerShell
摘要:如上 将指定目录下的所有的文件名从 old 改成 new.. adding -WhatIf at the end of the command we are saying to PowerShell: 'Just test, don't actually make any permanent cha 阅读全文
posted @ 2018-05-23 11:12 fdyang 阅读(12015) 评论(1) 推荐(1)

摘要:http://powershell.com/cs/blogs/ebookv2/archive/2012/03/23/chapter-16-managing-windows-registry.aspx 阅读全文
posted @ 2014-04-18 14:04 fdyang 阅读(205) 评论(0) 推荐(0)

摘要:@echo offfor /l %%i in (1,1,5) do ( tasklist /fi "imagename eq sysprep.exe" | find /i "sysprep.exe" if not errorlevel 1 ( taskkill /F /IM "sysprep.exe" if errorlevel 0 goto :NEXT ) echo Retry to terminate sysprep process... %%i if %%i EQU 5 goto :SHUTDOWN ping 1... 阅读全文
posted @ 2013-03-26 19:59 fdyang 阅读(1810) 评论(0) 推荐(0)

摘要:(PowerShell) 文件操作Get current ps1 file's parent path$x = Split-Path -Parent $MyInvocation.MyCommand.DefinitionCreate a folder if it does not exist.$myNewFolder = $x +"myTestFolder\"if(!(Test-Path $myNewFolder)){new-item -path $x -name myTestFolder -type directory}Open a XML file , and g 阅读全文
posted @ 2013-02-02 22:47 fdyang 阅读(5142) 评论(0) 推荐(0)

摘要:1.FW要升级,需要修改相关XAML中的所有旧版本到新版本。通过PowerShell 可以非常方便的找到所有的相关文件。#查找本目录中下所有的xaml文件中的 ”1.0.101“ 字符串 select-string 1.0.101 *.xaml 2. 查找指定目录下所有CS文件中的特定的字符串# D:\MyProject\ 指定要递归遍历查找的目录# *.cs 要查找的文件# myString 要查找的字符串$fileList = Get-ChildItem “D:\MyProject\" -recurse *.cs | %{$_.FullName}Foreach($file in 阅读全文
posted @ 2013-01-29 22:20 fdyang 阅读(14474) 评论(0) 推荐(0)