ServerOpsMenu.xml
<Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04">
<Obj RefId="0"> <TN RefId="0"> <T>System.Management.Automation.PSCustomObject</T> <T>System.Object</T> </TN> <MS> <S N="Title">Server Operations Tasks</S> <Obj N="Items" RefId="1"> <TN RefId="1"> <T>System.Object[]</T> <T>System.Array</T> <T>System.Object</T> </TN> <LST> <Obj RefId="2"> <TNRef RefId="0" /> <MS> <I32 N="ItemNumber">1</I32> <S N="MenuItem">Get Services</S> <SBK N="Action">Get-CimInstance Win32_Service | Select-Object 'DisplayName','Name','StartMode','State','Status' | Format-Table -AutoSize</SBK> </MS> </Obj> <Obj RefId="3"> <TNRef RefId="0" /> <MS> <I32 N="ItemNumber">2</I32> <S N="MenuItem">Restart Service</S> <SBK N="Action">Get-Service (Read-Host 'Service Name') | Restart-Service -Confirm -Force -Verbose</SBK> </MS> </Obj> <Obj RefId="4"> <TNRef RefId="0" /> <MS> <I32 N="ItemNumber">3</I32> <S N="MenuItem">Get Top 5 Processes by CPU</S> <SBK N="Action">Get-Process | Sort-Object -Descending -Property CPU | Select-Object -First 5 | Format-Table -AutoSize</SBK> </MS> </Obj> <Obj RefId="5"> <TNRef RefId="0" /> <MS> <I32 N="ItemNumber">4</I32> <S N="MenuItem">Get Top 5 Processes by Memory</S> <SBK N="Action">Get-Process | Sort-Object -Descending -Property WS | Select-Object -First 5 | Format-Table -AutoSize</SBK> </MS> </Obj> <Obj RefId="6"> <TNRef RefId="0" /> <MS> <I32 N="ItemNumber">5</I32> <S N="MenuItem">Stop Process</S> <SBK N="Action">Get-Process (Read-Host 'Process Name') | Stop-Process -Confirm -Force -Verbose</SBK> </MS> </Obj> <Obj RefId="7"> <TNRef RefId="0" /> <MS> <I32 N="ItemNumber">6</I32> <S N="MenuItem">Get Volumes</S> <SBK N="Action">Get-CimInstance Win32_LogicalDisk | Where-Object DriveType -eq 3 | foreach {[pscustomobject]@{ID = $_.DeviceID;VolumeName = $_.VolumeName;'Disk Space' = '{0}GB/{1}GB Used' -f (([math]::round($_.Size/1GB)-[math]::round($_.FreeSpace/1GB))),([math]::round($_.Size/1GB))}}</SBK> </MS> </Obj> <Obj RefId="8"> <TNRef RefId="0" /> <MS> <I32 N="ItemNumber">7</I32> <S N="MenuItem">Get Recent System Eventlog</S> <SBK N="Action">Get-Eventlog -LogName System -Newest 50 | Select-Object Index, TimeGenerated, InstanceID, EntryType, Message | Format-Table -AutoSize</SBK> </MS> </Obj> <Obj RefId="9"> <TNRef RefId="0" /> <MS> <I32 N="ItemNumber">8</I32> <S N="MenuItem">Restart Server</S> <SBK N="Action">Restart-Computer -Confirm -Force</SBK> </MS> </Obj> </LST> </Obj> </MS> </Obj> </Objs> |