# change file constrain# http://www.cnblogs.com/binw/p/3921743.html
Get-Acl -Path <File or Folder Path> | Format-List
# get one file's right and give it to another
Get-Acl "W:\Test\test01.txt" | Set-Acl -Path "W:\Test\test02.txt"# WinSCP does batch processing# http://www.cnblogs.com/binw/p/4065607.html
# a reference blog# http://www.cnblogs.com/dreamer-fish/archive/2013/01/26/2878144.html
# some basic operations
# remove all files in a folder
Remove-Item C:\tobedeleted –Recurse
# reborn current computer
(Get-WmiObject -Class Win32_OperatingSystem -ComputerName .).Win32Shutdown(2)
# get all child item recururse
Get-ChildItem –Force c:\directory –Recurse
Get-WmiObject -Class Win32_ComputerSystem
Get-WmiObject -Class win32_BIOS -ComputerName .
Get-WmiObject -Class Win32_QuickFixEngineering -ComputerName .
# get current user
Get-WmiObject -Class Win32_ComputerSystem -Property UserName -ComputerName .
Get-WmiObject -Class Win32_Product -ComputerName . | Format-Wide -Column 1
# current IP address
Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName . | Format-Table -Property IPAddress
Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE -ComputerName . | Select-Object -Property [a-z]* -ExcludeProperty IPX*,WINS*
Get-WmiObject -Class win32_networkadapterconfiguration -Filter"DHCPEnabled = true" -ComputerName .
Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=true -ComputerName . | ForEach-Object -Process {$_.EnableDHCP()}