No windows console found. Are you running cmd.exe? What is exact reason for this error? - powershell

I created a classic CI pipeline in azure devops to run aws commands using "AWS CLI template". I used "aws configure sso" command in AWS CLI but when I run the pipeline, I'm getting this error- No windows console found. Are you running cmd.exe? And the process failed with exit code 255" what is this error exactly and please anyone tell me, how can I remove it?

What is the OS of the agent you used to run the CI pipeline? Windows, Linux or macOS?
According to the introduction about the extension "AWS Toolkit for Azure DevOps", the AWS CLI task is only available on Windows agent.
Looks like this task can only call the cmd.exe to execute the command. And the cmd.exe is only available on Windows.
[UPDATE]
What agent did you use? Microsoft-hosted Windows agent, or self-hosted Windows agent?
Please make sure the cmd.exe has been installed on the Windows machine, and has been added to the system environment variable.
You can run the bash command printenv to list all the system environment variables, then check if this COMSPEC=C:\Windows\system32\cmd.exe is listed.
If the cmd.exe also has been installed correctly on your local Windows machine, you can try directly executing the related AWS CLI command on you local Windows machine to see if the same issue occurs. If the same issue occurs, the problem should occur on the AWSCLI itself.
If the issue only occurs when using the AWS CLI task, the issue should occur on the task itself, you can report this issue on the Q & A tab of the extension on Marketplace.

Related

Azure Pipeline - exe install hanging

Having an unusual issue where as part of a step in my Azure Pipeline, i am installing an application (.exe) via cmd/script.
The self hosted agent is running on my PC. When the pipeline triggers the exe install step (quite/headless mode) , the installer hangs.
If I run the same command from my command prompt, it installs fine.
Tested with notepad++ to see if it was an issue with my own application and same probelem exists.
Do i need to specify any additional privileges when installing an exe from Azure pipeline

Cannot configure a TFS build agent with Powershell ISE

After downloading the vNext build agent from VSTS page or from on-premises TFS, I followed the steps to configure agent in Powershell ISE.
Upon running .\config.cmd, there is a display of >> Connect:
There is no other prompt further to proceed with the configuration like below.
Tried the same with Powershell console and it worked.
Why is it so? Why is it not working with ISE?
The PowerShell ISE does not support console applications that require interactive input. You can check this blog.
So you need to use PowerShell Console or Command Prompt to config build agent.

How to Connect to Azure from Visual Studio Code Terminal

I have installed the required software and Azure PowerShell cmdlets on local system. I tried to execute a powershell script by connecting to Azure from Visual Studio Code Terminal. Below is the error.
Import-Module Microsoft.Online.SharePoint.PowerShell
function PublishToAzure{
Add-AzureAccount
......
......
}
Error is..
Add-AzureAccount : The handle is invalid
Visual Studio Code Settings:
// Place your settings in this file to overwrite the default settings
{
"terminal.integrated.shell.windows": "C:\\WINDOWS\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe"
}
Console of Windows Azure Active Directory Module for Windows PowerShell Properties
Target is:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -NoExit -Command "Import-Module MSOnline"
System Properties: 64bit Win7 OS
You may connect and manage Azure resources from within VS Code's terminal window by installing Microsoft Azure CLI 2.0. (https://aka.ms/InstallAzureCliWindows).
After CLI 2.0 is successfully installed in your environment, add the CLI 2.0 components to your environment path.
For example, my environment is Windows 10 and VS Code v1.13.0. I successfully ran the CLI 2.0 MSI installer for Windows. In my VS Code terminal session, I add the path to my PowerShell environment via this command:
$Env:Path += ';C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin'
To work within my Azure subscription(s), first I login via the command
az login
Follow the prompts to browse to a URL to complete the login to your Azure account and authorize the CLI session. Additional help on CLI 2.0 commands may be found at this link, https://aka.ms/cli
I know this thread is old and my answer a bit late but I hope this helps someone.
Cheers,
CarnegieJ

Can Jenkins run executable files called through a PowerShell script?

I have to install a program on a Windows 8 server using Jenkins as a framework. I wrote a PowerShell script that does run and install executable files when run through the PowerShell console. This does not happen when I run the same scripts through Jenkins.
Nothing happens except the text I output does appear on Jenkins' console.
Can running an .exe be done on Jenkins through a PowerShell script? Please help! Thanks :)
Read a similar answer here:
Open Excel on Jenkins CI
The issue is that Jenkins on Windows usually runs in "Session 0". Which is not visible to the logged in user. The trick is to launch the process (Excel in that answer, PowerShell in your case) in session 1.

How do I run a windows installer via telnet using the trial version?

I'm evaluating install4j in our company.
We build a win32 installer and we are trying to set up a continuous integration environment to test it.
The CI server is able to upload the installer to the windows target machine (which is a virtualized environment) using FTP, and run batch script that looks like
cd c:\tmp\upload\
my_installer.exe -q -varfile response.varfile -console
Currently we're using the trial version of install4j 5.
When the installer is ran from the command line (cmd.exe over remote desktop) I get a popup window that warns about the trial version.
Installation is frozen until I click ok.
When the installer is ran from telnet the command just hangs and never returns. I believe the reason is that popup window.
To fully evaluate install4j we need to be able see how it fits our CI process.
Is there any workaround for this?
This is a restriction of the evaluation version, with a permanent license key the evaluation dialog will not be shown and the problem will go away.