PS: Querying Event Viewer made easy

List all error events since a specified date in the past: Set a variable to a date that you want to see all error events after that: PS C:> $today = get-date 2/15/11 PS C:> get-eventlog -logname application -Source "*error*" -after $today | ft -auto Index Time         EntryType   Source                  InstanceID Message —– —-         ———   ——                  ———- ——- 9783 Mar 13 10:42 Information Windows Error Reporting       1001 Fault bucket , type 0… 9594 Mar 07 00:08 Information Windows Error Reporting       1001 Fault bucket , type 0… 9272 Mar 06 19:34 Information Windows Error Reporting       1001 Fault bucket , type 0… 9271 […]

Read more

Accessing Powershell cmdlets

There are various ways you can access Powershell cmdlets and here are few I know about: Launching the PS cmdlet with path from snap-in: PS C:> get-command get-date | format-table -property commandtype, name, pssnapin, module -auto CommandType  Name       pssnapin                       Module ———–  —-       ——–                       ——      Cmdlet  Get-Date   Microsoft.PowerShell.Utility PS C:> Microsoft.PowerShell.Utilityget-date Wednesday, March 09, 2011 7:43:09 PM PS C:> .

Read more

Knowing about Powershell cmdlets

How to check a given PS cmdlet belongs to what and where it’s located? …here are few simple PS commands that helps you with this. [7]: get-command invoke-item, get-date | format-table -property commandtype, name, pssnapin, module -auto CommandType Name        PSSnapIn                        Module ———– —-        ——–                        ——      Cmdlet Invoke-Item Microsoft.PowerShell.Management            Cmdlet Get-Date    Microsoft.PowerShell.Utility          [8]:   List all the supported/available functions/methods and properties/attributes of a PS cmdlet: [40]: get-command | get-member | ft Name, MemberType -auto | wc -l 64 [41]: List all the supported/available functions/methods of a PS cmdlet: [1]: get-command | get-member -Type method    TypeName: System.Management.Automation.AliasInfo Name        MemberType […]

Read more