I am trying to create script in which I can simultaneously access both Linux and Unix by using Powershell
script, but I am facing problem whenever I run script it's opening Unix window but after existing from Unix session. I am able to access window session. I don't want to exit from Unix session. I want to use both. Please advise. Below is my code
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null
$prompt = new-object -comobject wscript.shell
$getPasswordAIX = Get-Credential -UserName "Avni" -Message "Enter password"
$passwordAIX = $getPasswordAIX.GetNetworkCredential().password
$userAIX = $getPasswordAIX.GetNetworkCredential().username
#.\plink.exe mlismbc014 -i H:\davinsi.ppk -l $userAIX -pw $passwordAIX
.\plink.exe mlismbc014 -i H:\Key\unixKeys\avni.ppk -l $userAIX -pw $passwordAIX
echo %errorlevel%
Write-Host "Press any key to continue ..."
$anyKey = $host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")
$pshost = Get-Host # Get the PowerShell Host.
$pswindow = $pshost.UI.RawUI # Get the PowerShell Host's UI.
$newsize = $pswindow.BufferSize # Get the UI's current Buffer Size.
$newsize.width = 150 # Set the new buffer's width to 150 columns.
$pswindow.buffersize = $newsize # Set the new Buffer Size as active.
$newsize = $pswindow.windowsize # Get the UI's current Window Size.
$newsize.width = 150 # Set the new Window Width to 150 columns.
$pswindow.windowsize = $newsize # Set the new Window Size as active.
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null
$prompt = new-object -comobject wscript.shell