AzurePS System capability is not available on a newly installed vsts-agent - azure-devops

I have successfully installed a new VSTS agent on a new Azure VM - Windows Server 2012 R2 (64bit). When I am try to execute any pipelines containing azure powershell tasks on the new vsts agent, I get an error message :-
Error message 'No agent found in pool BuildAgent2 which satisfies the specified demands:azureps Agent.Version -gtVersion 2.119.1'
Is there any way to add AzurePS as a system capability ?
Please advise on the steps to do this - thanks.

AzurePS System capability is not available on a newly installed vsts-agent
Agree with jessehouwing.
If you want to enable AzurePS System capability, you could install the PowerShell 5.1 or higher on Windows, or PowerShell Core 6.x and later on all platforms, then install/update the Azure PowerShell module on the Azure VM:
Install the Azure PowerShell module
But the error you got should more related to the demands you set on the option tab of your build :
Check the agent version you have installed, make sure you set the correct version, or you can try to remove that demands to check if you still have this issue.
Hope this helps.

I got the same error using the AzureFileCopy#4 task in a self-hosted agent, but I solved it by installing the az module https://www.powershellgallery.com/packages/Az
Install-Module -Name Az

Related

##[error]The target of the specified cmdlet cannot be a Windows client-based operating system

I have created a build and release pipeline in Azure DevOps, and I have been trying to deploy my ASP.NET Core Website on my local machine, but I am getting this error:
"The target of the specified cmdlet cannot be a Windows client-based operating system."
Does this mean it's impossible to deploy to IIS on a client-based operating system, or, do I need to fix something?
Thank you.
The problem was that I did not have IIS enabled in "Windows Features" dialog, that you can find in Control Panel > Turn Windows Features On and Off.

Linux Hosted Agents and Azure Artifacts (Symbols Publishing)

Currently when I run the Publish symbols task on the Ubuntu hosted agent I get the following error "The current operating system is not capable of running this task. That typically means the task was written for Windows only. For example, written for Windows Desktop PowerShell."
I have run this task successfully on a Windows Agent but what I have seen it doesn't work on Linux. The only thing that I have seen that could work on Linux is SourceLink but that doesn't work with Azure DevOps Artifacts yet.
Looking around I'm not able to see any way to publish symbols to Azure DevOps artifacts on a Linux agent? Has anybody else encountered this issue and were you able to get around it?

Packer - Windows Server 2012R2 - Install PowerShell 5

I'm having trouble with installing PowerShell 5 on Windows Server 2012 R2 using Packer.
To install PowerShell 5.1, I'm using chocolatey
powershell
iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex
choco install PowerShell -y
I need to to do this for two packer builder:
Amazon Web Services EC2 AMI.
Hyper-V Vagrant.
With the Amazon Web Services EC2 AMI I've tried executing the above from the following locations
As part of the user_data_file script.
As an inline provision script.
I've added the windows-restart provision in the flow after the execution of the fragment.
Similarly I've tried the same with the Hyper-V Vagrant both as part of the Autounattend flow and as an inline provision.
In both cases the installation fails because the user profile is not created. At least I think that is the problem. As a reference, I've faced the exact same problem when installing sql server express.
Has anyone managed to accomplish this flow and what is your recommendation?
PowerShell package uses MSU (Windows Update file). There are a couple of considerations here:
Ensure Windows Updates Service is turned on. Chocolatey doesn't do that yet, although there is an issue filed.
MSUs must be run locally from the machine. So if you are running over WinRM, you instead need to have it set up a scheduled task to call choco install and then run it that way.
Yes, that second point is accurate. No, it is not Chocolatey's fault. That's a Microsoft design decision with MSU files. It's a real PITA.
FYI - BoxStarter handles it appropriately, and it can be used with Packer. You will find less pain if you look there.
HTH

Is it possible to upgrade Azure Powershell (ISE) in Windows Server 2012 R2 without reinstalling?

I'm running Windows Server 2012 R2 in an Azure VM in which I have an older version of Azure Powershell (ISE) - when I run . I searched for instructions on how to update Azure Powershell (ISE) but all I'm finding is on how to install from scratch per http://azure.microsoft.com/en-us/documentation/articles/install-configure-powershell/
Is there a way to upgrade without having to re-import the Azure subscription publish-settings file etc ?
By the way, an easy way to find out what version I'm on would be great. Doing get-module azure or get-module does not give me version info per http://cropme.ru/fc7037d19a74cd0db256c52142d9b98a
After you upgrade the Azure PowerShell module, you can just run Add-AzureAccount to update your subscription settings.

TFS 2010 - Nightly Builds of WiX MSI for WebApplication/Windows Service and install to web server

Can you please enlighten me on my task?
My task is to create a nightly builds of MSI (done in WiX) and install it to our web server using powershell.
TFSBuild server build an MSI
Run Powershell to uninstall and install the newly build MSI.
Run Powershell to Start the windows service.
The WiX MSI contains WindowsService and a Web Application.
Below are list of what i have done so far:
Solution.sln : Configuration Manager and "x86|debug" (check all the files that needs to be built '.wixproj' already checked)
Created a build definition and set "x86|debug" for configurations to build and set projects to build is my solution file.
but after the build has completed, there is no MSI files on the binaries build folder on the build server. :(
Thanks in advance.
Few pointers:
Have you installed Wix on the buildserver?
Which version of Team Build are you using? 2010 has the preference here as the tooling has progressed a lot since 2008.
Did you configure to run msbuild in auto or x86 mode (auto can result in 64-bit which has some issues with the latest stable version of wix) link link
Is your build agent running on a 64 bit server? If so, you either need to run the build agent under an administrative account or do some mucking around in the registry to fix issues with Wix. link
To install the build using Powershell, I personally prefer TFSDeployer, which can monitor your build output and trigger powershell scripts based on the build outcome. It takes away the deployment responsibility from the build server and saves a lot of headaches around security and account configurations.