- 12 Cool Features of Windows PowerShell
- Built-in Cmdlets (pronounced "commandlets") for Managing Windows
- The power of wildcards and working objects
- Whatif you could test your commands before committing to them
- PS> stop-service w3* -whatif
- Take a transcript
- PS> Start-Transcript -Path c:\demo\dfoshow.txt
PS> Stop-Transcript - Make Windows talk from the command line
- PS> $spVoice = new-object -com "SAPI.spvoice"
PS> $spVoice.Speak("Windows Vista and PowerShell") - Using Windows PowerShell to access applications such as Windows Media Player 11
- PS> $band = "The Posies"
PS> $player = New-object -com wmplayer.ocx
PS> $playlist = $player.mediacollection.getbyauthor($band)
PS> $player.openPlayer($playlist.item(0).sourceurl) - Windows PowerShell as a command line storage calculator
- Using PowerShell as a calendar calculator
- PS> ([DateTime]"1/1/2007" -[datetime]::now).days
- How many files of type X do I have on my machine?
- PS> dir -include *.vbs, *.ps1, *.bat -recurse | group-object extension -noelement
- Collecting Windows System Assessment Tool data from the command line
- Configuring User Account Control
- Windows Vista's User Account Control (UAC) helps improve security by requiring that all programs run in standard user mode by default, rather than with administrator privileges
- PS> set-itemproperty -path HKLM:\SOFTWARE\MICROSOFT\WINDOWS\CurrentVersion\Policies\System -name ConsentPromptBehaviorAdmin -value 0
- Managing BitLocker with PowerShell
- Vista's BitLocker feature helps prevents data loss via encryption
- PS > $drives = get-wmiobject -namespace root\CIMv2\Security\MicrosoftVolumeEncryption -class Win32_EncryptableVolume
PS> $drives | format-table DriveLetter, PersistentVolumeID -autosize
PS> $BitLockDrive = $drives[0]
PS> $BitLockDrive.GetProtectionStatus()
PS> $BitLockDrive.DisableKeyProtectors()
PS> $BitLockDrive.EnableKeyProtectors()
全站熱搜
留言列表