var shell = require('node-powershell');
let ps = new shell(
{
executionPolicy : 'bypass',
noProfile : true
}
);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Visual Studio Team Services REST API - PAT Authentication using PowerShell | |
| $UserName = "[email protected]" | |
| $PersonalAccessToken = "Access Token" | |
| $Authentication = "{0}:{1}" -f ($UserName,$PersonalAccessToken) | |
| $Authentication = [System.Text.Encoding]::ASCII.GetBytes($Authentication) | |
| $Authentication = [System.Convert]::ToBase64String($Authentication) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from zeep import Client | |
| from zeep.transports import Transport | |
| from requests import Session | |
| from requests.auth import HTTPBasicAuth | |
| session = Session() | |
| session.auth = HTTPBasicAuth('userName' , 'password') | |
| wsdl = "http://hostname:xxxx/sc62server/PWS/IncidentManagement.wsdl" | |
| client = Client(wsdl=wsdl,transport=Transport(session=session)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Clear-Host | |
| add-type @" | |
| using System.Net; | |
| using System.Security.Cryptography.X509Certificates; | |
| public class TrustAllCertsPolicy : ICertificatePolicy { | |
| public bool CheckValidationResult( | |
| ServicePoint srvPoint, X509Certificate certificate, | |
| WebRequest request, int certificateProblem) { | |
| return true; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function Get-xEventById { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory)] | |
| $Uri, | |
| [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] | |
| $Mcueid, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Import-Module .\assemblies\Microsoft.SharePoint.Client.dll | |
| Import-Module .\assemblies\Microsoft.SharePoint.Client.UserProfiles.dll | |
| $userName = "[email protected]" | |
| $adminPassword = "MySuperPassword" | ConvertTo-SecureString -AsPlainText -Force | |
| $spoCredential = [Microsoft.SharePoint.Client.SharePointOnlineCredentials]::new($userName, $adminPassword) | |
| $spoClientContext = [Microsoft.SharePoint.Client.ClientContext]::new("https://chensoffice365-admin.sharepoint.com") | |
| $spoClientContext.Credentials = $spoCredential | |
| $spoUsers = $spoClientContext.Web.SiteUsers | |
| $spoClientContext.Load($spoUsers) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [pscustomobject]@{ | |
| FirstName = "Chendrayan" | |
| LastName = "Venkatesan" | |
| DisplayName = "Chendrayan Venkatesan" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| html(lang="en") | |
| head | |
| meta(charset="UTF-8") | |
| meta(name="viewport", content="width=device-width, initial-scale=1.0") | |
| meta(http-equiv="X-UA-Compatible", content="ie=edge") | |
| title Wizard | |
| style | |
| include ./style/style.css | |
| link(rel="stylesheet", href="https://fonts.googleapis.com/css?family=Raleway") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Get-Date | ConvertTo-Json -Compress |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Import-Module Polaris -Verbose | |
| Import-Module PSHTML -Verbose | |
| Add-Type -AssemblyName System.Web | |
| New-PolarisGetRoute -Path "/Login" -Scriptblock { | |
| $HTML = html { | |
| head { | |
| Title "Login Page" | |
| } |
OlderNewer