<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
###################################################### | |
# Download custom PowerShell profile file | |
###################################################### | |
Write-Host "Creating custom $profile for Powershell" | |
if (!(test-path $profile)) { | |
New-Item -path $profile -type file -force | |
} | |
Add-Content $profile ((new-object net.webclient).DownloadString('https://gist.githubusercontent.com/jplindgren/a3aefc76b1667e4fefa6a47f9974974e/raw/a6bceca451f08e765bd49e137656b1a25f4aa7b1/myprofile.ps1')) | |
Write-Host |
# Check if Running as Admin | |
$IsAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") | |
if (-not $IsAdmin) { | |
if ($MyInvocation.ScriptName -ne "") { | |
try { | |
Write-Host "Relanuching Script as Admin" | |
$arg = "-file `"$($MyInvocation.ScriptName)`"" | |
Start-Process "$psHome\powershell.exe" -Verb Runas -ArgumentList $arg -ErrorAction 'stop' | |
} catch { |
# Check if Running as Admin | |
$IsAdmin = ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator") | |
if (-not $IsAdmin) | |
{ | |
if ($MyInvocation.ScriptName -ne "") | |
{ | |
try | |
{ | |
Write-Host "Relanuching Script as Admin" |
function Add-Path() { | |
[Cmdletbinding()] | |
param([parameter(Mandatory=$True,ValueFromPipeline=$True,Position=0)][String[]]$AddedFolder) | |
# Get the current search path from the environment keys in the registry. | |
$OldPath=(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path | |
# See if a new folder has been supplied. | |
if (!$AddedFolder) { | |
Return 'No Folder Supplied. $ENV:PATH Unchanged' | |
} | |
# See if the new folder exists on the file system. |
# http://boxstarter.org/package/url? | |
##################### | |
# BEGIN CONFIGURATION | |
##################### | |
#region Initial Windows Config | |
Install-WindowsUpdate -AcceptEula | |
Update-ExecutionPolicy Unrestricted |
//How to update an XPO schema and create the XPObjectType table | |
using (Session session = new Session()) | |
{ | |
//Here we select one class from each assembly that contains XPO classes | |
//For example User is one of our XPO object model classes | |
Assembly[] array = { typeof(User).Assembly, typeof(XPObjectType).Assembly }; | |
session.UpdateSchema(array); | |
} |
namespace Sagas | |
{ | |
using System; | |
using System.Collections.Generic; | |
class Program | |
{ | |
static ActivityHost[] processes; |
#variables | |
$url = 'http://localhost:8080/jnlpJars/jenkins-cli.jar'; | |
$jenkinsTempCliDir = Join-Path $env:TEMP "jenkinsClient" | |
if (![System.IO.Directory]::Exists($jenkinsTempCliDir)) {[System.IO.Directory]::CreateDirectory($jenkinsTempCliDir)} | |
$file = Join-Path $jenkinsTempCliDir "jenkins-cli.jar" | |
#functions | |
function Download-File { | |
param ( [string]$url, [string]$file ) |
public static class TestHelpers | |
{ | |
public static void ShouldEqualWithDiff(this string actualValue, string expectedValue) | |
{ | |
ShouldEqualWithDiff(actualValue, expectedValue, DiffStyle.Full, Console.Out); | |
} | |
public static void ShouldEqualWithDiff(this string actualValue, string expectedValue, DiffStyle diffStyle) | |
{ | |
ShouldEqualWithDiff(actualValue, expectedValue, diffStyle, Console.Out); |