Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 176561

Simple .ps1 script runs successfully within powershell, fails when called from AzureDevOps Pipeline.

$
0
0

#vcconnect.ps1

Get-VICredentialStoreItem -File C:\Users\*******\AppData\Roaming\VMware\credstore\vicredentials.xml | %{
Connect-VIServer -Server $_.host -User $_.User -Password $_.Password
}

#Successful run within PS...
PS D:\ECE\vCenter\tested> .\vcconnect.ps1
Name                           Port  User
----                           ----  ----
xxx.xxx.xxx.xxx                443   *****\******
xxx.xxx.xxx.xxx                443   *****\******

#Fail from AzureDevOps...
2020-08-13T02:39:37.2754305Z     + CategoryInfo          : WriteError: (:) [Get-VICredentialStoreItem], ParentContainsErrorRecordException
2020-08-13T02:39:37.2754933Z     + FullyQualifiedErrorId : ParameterBindingFailed,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetVICredentialStore 
2020-08-13T02:39:37.2755213Z    Item
2020-08-13T02:39:37.2755320Z  
2020-08-13T02:39:37.3521447Z ##[error]PowerShell exited with code '1'.


Viewing all articles
Browse latest Browse all 176561

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>