How to use the command Get-WUApiVersion (with examples)
- Windows
- December 25, 2023
This command is part of the external PSWindowsUpdate
module and is used to get the version of the Windows Update Agent. It can only be run under PowerShell.
Use case 1: Get the currently-installed Windows Update Agent version
Code:
Get-WUApiVersion
Motivation: The motivation for using this example is to quickly and easily determine the version of the Windows Update Agent that is currently installed on the system. This information can be useful for troubleshooting purposes or for verifying that the system is up-to-date with the latest version.
Explanation: This command is used to retrieve the currently-installed version of the Windows Update Agent. It does not require any arguments.
Example output:
13.2.16299.15
Use case 2: Send the current configuration data via email (SMTP)
Code:
Get-WUApiVersion -SendReport -PSWUSettings @{SmtpServer="smtp_server"; Port=smtp_port From="sender_email" To="receiver_email"}
Motivation: The motivation for using this example is to send the current configuration data of the Windows Update Agent via email using the Simple Mail Transfer Protocol (SMTP). This can be useful for monitoring purposes or for generating reports.
Explanation:
This command is used to send the current configuration data of the Windows Update Agent via email. The -SendReport
parameter is used to specify that the report should be sent via email. The -PSWUSettings
parameter is used to specify the settings for the email, including the SMTP server, port, sender email, and receiver email.
Example output: The output will vary depending on the email server configuration and the success or failure of the email sending process.