Skip to Main Content

Wmic Windows 11 Alternative Today

# Boot time (like wmic os get lastbootuptime) (Get-CimInstance Win32_OperatingSystem).LastBootUpTime System uptime (Get-Date) - (Get-CimInstance Win32_OperatingSystem).LastBootUpTime List all environment variables Get-ChildItem Env: Find specific process by command line Get-CimInstance Win32_Process -Filter "name = 'chrome.exe'" | Select-Object CommandLine User account information Get-CimInstance Win32_UserAccount | Select-Object Name, Disabled, Lockout Motherboard information Get-CimInstance Win32_BaseBoard | Select-Object Product, Manufacturer, Version Batch Script Migration Old WMIC batch file:

# Start a new process Start-Process -FilePath "notepad.exe" Start-Process -FilePath "cmd.exe" -ArgumentList "/c echo Hello" Service Management List Services

Get-CimInstance Win32_OperatingSystem | Select-Object -ExpandProperty Caption Get-CimInstance Win32_Processor | Select-Object -ExpandProperty Name Get-CimInstance Win32_LogicalDisk | Select-Object DeviceID, Size, FreeSpace wmic windows 11 alternative

# All services Get-Service Get-Service | Where-Object $_.Status -eq "Running" Detailed service info Get-CimInstance Win32_Service | Select-Object Name, State, StartMode

# Create custom functions to mimic WMIC syntax function wmic-os Get-CimInstance Win32_OperatingSystem function wmic-cpu Get-CimInstance Win32_Processor function wmic-disk Get-CimInstance Win32_LogicalDisk function wmic-service Get-Service function wmic-process Get-Process function Get-SystemSummary [PSCustomObject]@ Measure-Object -Property Capacity -Sum).Sum / 1GB, 2) ComputerName = $env:COMPUTERNAME # Boot time (like wmic os get lastbootuptime)

param( [string]$Class, [string]$Get, [string]$Where ) switch ($Class) "os" Get-CimInstance Win32_OperatingSystem "cpu" Select-Object * "diskdrive" Get-CimInstance Win32_DiskDrive "logicaldisk" Select-Object * "process" Get-Process "service" Select-Object * "product" Get-Package default Write-Host "Class not supported in this compatibility script"

# Better alternative to wmic product Get-Package | Select-Object Name, Version, ProviderName Get-ItemProperty HKLM:\Software\Microsoft\Windows\CurrentVersion\Uninstall* | Select-Object DisplayName, DisplayVersion For 64-bit apps Get-ItemProperty HKLM:\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall* | Select-Object DisplayName, DisplayVersion BIOS Information # BIOS details Get-CimInstance Win32_BIOS | Select-Object Manufacturer, Name, SerialNumber, Version Network Configuration # IP configuration Get-NetIPAddress | Select-Object InterfaceAlias, IPAddress, AddressFamily Network adapters Get-NetAdapter | Select-Object Name, InterfaceDescription, Status, LinkSpeed Instead of wmic nic get Get-CimInstance Win32_NetworkAdapter | Where-Object $_.NetEnabled -eq $true Creating Useful Aliases Add these to your PowerShell profile for quicker transitions: 2) ComputerName = $env:COMPUTERNAME param( [string]$Class

# Stop a service Stop-Service -Name Spooler Start-Service -Name Spooler Change startup type Set-Service -Name Spooler -StartupType Automatic Software/Product Management List Installed Software

wmic windows 11 alternative