PowerShell is a command line and scripting language that provides native access to .NET classes, COM objects, WMI, and XML. It allows administrators to leverage these APIs and formats output for improved productivity. The document demonstrates PowerShell's ability to investigate systems, manipulate and transform objects, and access existing instrumentation through demos. It provides resources for learning PowerShell including documentation, books, community forums, and code repositories.
10. Learn and Leverage In the box documents Release Notes Getting Started, User’s Guide, Quick Reference Help Discovery utilities Books Community Practice ad hoc development
17. PowerShell provides native access to any .NET class Create any object [reflection.assembly]::LoadWithPartialName("System.Windows.Forms") $d = New-Object System.DateTime 2006,12,25 Access Properties/Invoke Methods $d.DayOfWeek $d.AddDays(-30) Access Statics [DateTime]::Now [DateTime]::IsLeapYear(2008) Scripting with .NET Allows admins to easily access and leverage a huge API set because of scriptability, utilities and formatting
19. Access existing instrumentation Bind to COM objects $fso = New-Object -ComObjectScripting.FileSystemObject $m = [System.Runtime.InteropServices.Marshal] $word = $m::GetActiveObject("Word.Application") Invoke methods/access properties $fso.GetDrive(“C:”) $fso.VolumeName = “System Drive” Manipulate and format results Define and import custom formating Update-FormatData Office.Word.Format.ps1xml $word.RecentFiles | Sort name | Format-Table Scripting with COM Allows more simpler/more powerful COM scripts because of utilities and formatting
20. PowerShell provides native WMI support Get-WmiObject Allows for inspection of WMI namespace Get-WmiObject –list [-Namespace xx] Get-WmiObject –Class xx –Namespace xx –Property xxx – Filter xxx –ComputerName xxx –Credential xxx Native language support [WMI] “JPSDESK10ootimv2:Win32_Process.Handle="0“ [WMICLASS] "ROOTimv2:WIN32_PROCESS" [WMISEARCHER]"select * from Win32_process WHERE Name = 'calc.exe'" Scripting with WMI
24. Community Resources Newsgroup: Microsoft.Public.Windows.PowerShell Team blog: http://blogs.msdn.com/PowerShell/ PowerShell Community: http://www.PowershellCommunity.Org Community Script Repo http://www.poshcode.org Channel 9 http://channel9.msdn.com/tags/PowerShell Wiki http://channel9.msdn.com/wiki/default.aspx/Channel9.WindowsPowerShellWiki Script Center: http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx CodePlex: http://codeplex.com/Project/ProjectDirectory.aspx?TagName=powershell Many excellent books Manning Press book by PowerShell Dev Lead Bruce Payette: PowerShell in Action http://manning.com/powershell/ O’Reilly book by PowerShell Dev Lee Holmes – Windows PowerShell Cookbook http://www.oreilly.com/catalog/9780596528492/index.html Session Demos for Introduction To Powershell
This template can be used as a starter file for presenting training materials in a group setting.SectionsRight-click on a slide to add sections. Sections can help to organize your slides or facilitate collaboration between multiple authors.NotesUse the Notes section for delivery notes or to provide additional details for the audience. View these notes in Presentation View during your presentation. Keep in mind the font size (important for accessibility, visibility, videotaping, and online production)Coordinated colors Pay particular attention to the graphs, charts, and text boxes.Consider that attendees will print in black and white or grayscale. Run a test print to make sure your colors work when printed in pure black and white and grayscale.Graphics, tables, and graphsKeep it simple: If possible, use consistent, non-distracting styles and colors.Label all graphs and tables.