This file contains 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
#stop service | |
Stop-Service 'OctopusDeploy Tentacle:*' -ErrorAction Continue | |
# download tentacle | |
$tentacle = "$Env:TEMP\tentacle.msi" | |
Invoke-WebRequest -UseBasicParsing -Uri https://download.octopusdeploy.com/octopus/Octopus.Tentacle.6.0.0-x64.msi -OutFile $tentacle | |
# install/update tentacle | |
Start-Process msiexec.exe -ArgumentList "/i $tentacle /qb" -Wait |
This file contains 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 Test-DynamicParameters { | |
# CmdletBinding is mandatory for using dynamic parameters | |
[CmdletBinding(DefaultParameterSetName = "default")] | |
param ( | |
# One DynamicParam will only be usable if $name contains at least 2 elements | |
[Parameter(mandatory = $false)] | |
[ValidateNotNullOrEmpty()] | |
[String[]] | |
$Name | |
This file contains 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
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Scope='Function')] | |
Param() | |
BeforeAll { | |
. $PSCommandPath.Replace('.Tests.ps1','.ps1') | |
} | |
Describe Start-ProcessPlus { | |
Context 'Basic tests' { | |
It "Invoking ping on localhost. This should always work" { | |
$result = Start-ProcessPlus -FilePath ping.exe -ArgumentList 'localhost' |
This file contains 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
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Scope='Function')] | |
Param() | |
BeforeAll { | |
. $PSCommandPath.Replace('.Tests.ps1','.ps1') | |
} | |
Describe Get-NormalizedVersion -Tag Unit{ | |
Context 'Basic tests' { | |
It "1 -> 1.0.0" { | |
Get-NormalizedVersion 1 | Should -Be '1.0.0' |
This file contains 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
# https://docs.docker.com/compose/yml/ | |
# Each service defined in docker-compose.yml must specify exactly one of | |
# image or build. Other keys are optional, and are analogous to their | |
# docker run command-line counterparts. | |
# | |
# As with docker run, options specified in the Dockerfile (e.g., CMD, | |
# EXPOSE, VOLUME, ENV) are respected by default - you don't need to | |
# specify them again in docker-compose.yml. | |
# | |
service_name: |
This file contains 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
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"version": 2, | |
"final_space": true, | |
"console_title_template": "{{if .Root}}root {{end}}{{ .Shell }} in {{ .Folder }}", | |
"blocks": [ | |
{ | |
"type": "prompt", | |
"alignment": "left", | |
"segments": [ |
This file contains 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
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Scope='Function')] | |
Param() | |
BeforeAll { | |
. $PSCommandPath.Replace('.Tests.ps1','.ps1') | |
} | |
Describe "ConvertTo-SemVersion Tests" { | |
Context "When providing a valid version" { | |
It "Should normalize version 1 to 1.0.0" { | |
$version = "1" |
This file contains 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
# transformation class that transforms string to service controller object | |
class ServiceSingleTransformation : System.Management.Automation.ArgumentTransformationAttribute { | |
[object] Transform([System.Management.Automation.EngineIntrinsics]$EngineIntrinsics, [object] $InputData) { | |
$item = $InputData | |
if ($item -is [string]) { | |
$item = Get-Service -name "$item" | |
}elseif ($item -is [System.ServiceProcess.ServiceController]) { | |
$item = $item | |
}else { |
This file contains 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
# Choco settings | |
$ChocolateyProfile = "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" | |
if (Test-Path($ChocolateyProfile)) { | |
Import-Module "$ChocolateyProfile" | |
} | |
# Install and load modules | |
$modulesToLoad = @('DockerCompletion', 'CompletionPredictor') | |
foreach ($module in $modulesToLoad) { | |
if (! (Get-Module $module -ListAvailable)) { |