PowerShell

Tip: Retrieve servicenow CI item values using REST API (Turn on Display Value)

Posted on

In my last blog post I shared about ‘Scripted REST API’ getDisplayValue() tip. Now, here lets see Out of the Box option. When we query the CI with a query “sysparm_query=name=$($ConfigurationItem)&sysparm_limit=1” param ( $ConfigurationItem = ‘Car-3’ ) try { $Uri = “https://dev42835.service-now.com/api/now/table/cmdb_ci?sysparm_query=name=$($ConfigurationItem)&sysparm_limit=1” $admin = “admin” $password = “admin” | ConvertTo-SecureString -AsPlainText -Force $Credential = New-Object pscredential […]

PowerShell

Create VSTS Build Definitions using PowerShell

Posted on

For my current project assignment I was asked to share a PowerShell script which creates VSTS build + phase dynamically. To make this blog short let me show a simple build definitions sample. With no wait here is the code $Token = “Personal Access Token” $Authentication = [Text.Encoding]::ASCII.GetBytes(“:$Token”) $Authentication = [System.Convert]::ToBase64String($Authentication) $Headers = @{ Authorization […]