Hello Team,
Hope all are doing well!!
I am trying to install SQL 2016 using the below PowerShell script, however, I can see the script can invoke the setup.exe file but on the remote host background process not executing it seems. I waited for 2 hours but no response. Even the script is also not in a failed state. Can someone please help me to achieve this?
Process status attached of the remote host
Powershell Script:-
$vmPassword = "$$$$$$$$"
$vmUserName = "$$$$$$$$"
$ServerIP = "$$$$$$$$$"
$SecurePassword = $vmPassword | ConvertTo-SecureString -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential -ArgumentList ($vmUserName, $SecurePassword)
#Set trusted host file
Set-Item WSMan:\localhost\Client\TrustedHosts -Value "*" -Force
#New session
$remoteSession = New-PSSession -computerName $ServerIP -credential $Cred
$script = {
C:\install\setup.exe
}
Invoke-Command -Session $remoteSession -ScriptBlock $script -ArgumentList ConfigurationFile.ini -Debug
I have tried to achieve the same using Ansible modules but still no luck.
In ansible I have tried with win_command , win_shell , win_package , win_ps..etc
The same issue happened "Process are running" at the background but unable to execute properly
Ansible Script:-
- hosts: winhost tasks:
- name: Install SQL 2016 win_command: PowerShell.exe -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -File "C:\db_installation_command.ps1" become_method: runas become_user: Administrator
db_installation_command.ps1
C:\install\setup.exe '/ConfigurationFile="C:\ConfigurationFile.ini"'
Can someone please help me with this?
PSVersion 5.1.17763.5458