http://windowsvistablog.com/blogs/windowsvista/archive/2006/11/14/it-forum-day-one-windows-vista-and-windows-powershell.aspx

  • 12 Cool Features of Windows PowerShell
    1. Built-in Cmdlets (pronounced "commandlets") for Managing Windows
    2. The power of wildcards and working objects
    3. Whatif you could test your commands before committing to them
      • PS> stop-service w3* -whatif
    4. Take a transcript
      • PS> Start-Transcript -Path c:\demo\dfoshow.txt
        PS> Stop-Transcript
    5. Make Windows talk from the command line
      • PS> $spVoice = new-object -com "SAPI.spvoice"
        PS> $spVoice.Speak("Windows Vista and PowerShell")
    6. 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)
    7. Windows PowerShell as a command line storage calculator
    8. Using PowerShell as a calendar calculator
      • PS> ([DateTime]"1/1/2007" -[datetime]::now).days
    9. How many files of type X do I have on my machine?
      • PS> dir -include *.vbs, *.ps1, *.bat -recurse | group-object extension -noelement
    10. Collecting Windows System Assessment Tool data from the command line
    11. 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
    12. 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()
      •  

arrow
arrow
    全站熱搜

    ayowu 發表在 痞客邦 留言(0) 人氣()