From 94a5136f9e65d81fc77c9abb8313fce950f53643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Herranz=20Ram=C3=ADrez?= Date: Mon, 27 Jan 2025 10:34:06 +0100 Subject: [PATCH] Replaced deprecated `wmic` command --- lib/windowsbasetest.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/windowsbasetest.pm b/lib/windowsbasetest.pm index d832f61c227f..914409b1fad2 100644 --- a/lib/windowsbasetest.pm +++ b/lib/windowsbasetest.pm @@ -160,7 +160,7 @@ sub wait_boot_windows { $self->run_in_powershell(cmd => 'reg add "HKLM\Software\Policies\Microsoft\Windows\Explorer" /v DisableNotificationCenter /t REG_DWORD /d 1'); $self->run_in_powershell(cmd => 'reg add "HKLM\Software\Microsoft\Windows\CurrentVersion\PushNotifications" /v ToastEnabled /t REG_DWORD /d 0'); # Prevent password from expiring: - $self->run_in_powershell(cmd => 'wmic UserAccount set PasswordExpires=False'); + $self->run_in_powershell(cmd => 'Set-ADUser -Identity "username" -PasswordNeverExpires $true'); record_info 'Port close', 'Closing serial port...'; $self->run_in_powershell(cmd => '$port.close()', code => sub { }); $self->run_in_powershell(cmd => 'exit', code => sub { });