To determine the Windows version using PowerShell, the following command can be executed:
(Get-CimInstance Win32_OperatingSystem).Caption
This command retrieves information from the
Win32_OperatingSystem
WMI class, specifically the Caption
property, which contains the Windows version and edition.