PowerShel程序执行完后删除脚本自身的方法
当脚本执行完成后,可以删除自身
#删除脚本自身 remove-item $MyInvocation.MyCommand.Path -force
Powershell比较两个文件夹的不同
快速找出两个文件夹中不同的部分,可以使用下面例子:$list1=Get-ChildItemc:Windowssystem32|Sort-Object-PropertyName$list2=Get-ChildItem\server12c$windowssystem32|Sort-Objec
Powershell实现加密解密文本文件方法实例
适用于Powershell3.0及以后版本。假设你需要给文件加密,下面教你如何给自己的文件加密:$Path="$env:tempsecret.txt"$Secret='HelloWorld!'$Passphrase='Somesecretkey'$key=[
Powershell中获取所有磁盘盘符的方法
快速获取当前电脑所有磁盘:#requires-Version1[Environment]::GetLogicalDrives()结果如下:PSC:D:E:F:G: