From 1039dbe68a309b7e810f4e0cbad0a63784f33e29 Mon Sep 17 00:00:00 2001 From: mrsh Date: Sat, 10 Jan 2026 01:20:47 +0100 Subject: [PATCH] Add System_Management --- .../PowerShell System Management.md | 131 ++++++++++++++++++ README.md | 6 + 2 files changed, 137 insertions(+) create mode 100644 5.System_Management/PowerShell System Management.md diff --git a/5.System_Management/PowerShell System Management.md b/5.System_Management/PowerShell System Management.md new file mode 100644 index 0000000..8eec29f --- /dev/null +++ b/5.System_Management/PowerShell System Management.md @@ -0,0 +1,131 @@ +# PowerShell System Management + +## Get-ComputerInfo + +For having information about the system + +```powershell +Get-ComputerInfo + +$serverInfo = Get-ComputerInfo +$serverInfo.OsVersion +Get-ComputerInfo | Seleect-Object -Property 'Timezone' +``` + +## Processes + +Windows **processes** are running instances of programs that contain +their own memory space and system resources. +Each process can host one or more threads and is +managed by the operating system to provide isolation, scheduling, +and controlled access to system resources. + +### Get-Process + +For having all the process + +```powershell +Get-Process + +#find one by name +Get-Process -Name taskmngr + +Get-Process | Format-Table -Property Name, Id +``` + +### Start-Process + +start a process + +```Powershell +Start-Process -FilePath "C:\Windows\system32\notepad.exe" +``` + +### Stop-Process + +```powershell +Stop-Process -Name "notepad" + +Stop-Process -Name "notepad" -Force +``` + +## Service + +Windows **services** are background programs that run independently of +user logins and provide core system or application functionality. +They are managed by the Service Control Manager and can be started, +stopped, paused, or configured to run automatically, +making them essential for system stability, networking, +security, and ongoing operations. + +### Get-Service + +For listing every services + +```powershell +Get-Service -Name "Print Spooler" + +Get-Service | Format-Table -Property Statys, DisplayName + +Get-Service | Where-Object {$_.Status -eq "Stopped"} +Get-Service | Where-Object {$_.Status -eq "Running"} +``` + +### Stop-Service + +```powershell +Stop-Service -Name "Print Spooler" +``` + +### Start-Service + +```powershell +Start-Service -Name "Print Spooler" +``` + +### Restart-Service + +```powershell +Restart-Service -Name "Print Spooler" +``` + +## Volumes + +Windows **volumes** are logical storage units used to organize and +access data on physical disks. +They are formatted with a file system, assigned a drive letter or mount point, +and managed by the operating system to provide structured, +persistent storage for files and applications. + + +### Get-Volume + + +```powershell +Get-Volume + +Get-Volume -DriveLetter C | Format-List + +$CDrive = Get-Volume -DriveLetter C + +#To format Size Remaining output to GB +$CDrive.SizeRemaining/1GB +``` + +## Recycle Bin + +The Windows **Recycle Bin** is a special system folder that temporarily stores +deleted files and folders. +It allows users to restore items if they were removed accidentally, +acting as a safety mechanism before permanent deletion. + +## Clear-RecycleBin + +```powershell +Clear-RecycleBin + +Clear-RecycleBin -Drive C -Force +``` + + + diff --git a/README.md b/README.md index 8b238a7..5481129 100644 --- a/README.md +++ b/README.md @@ -37,3 +37,9 @@ For learning Active Directory Networking with powershell [Link to the video](https://youtu.be/LRdwjfIzaSY?si=7asuJK-tJw_LwYOz) + +## 5.System Management + +System Magement with powershell + +[Link to the video](https://youtu.be/46K4SxQdPIo?si=LW2iATNHcspsvrzR)