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
| class Age : System.IComparable { | |
| [datetime]$CreationTime | |
| static hidden [regex] $regex = [regex]'^(\d+\w)+$' | |
| age([datetime]$CreationTime){ | |
| $this.CreationTime = $CreationTime | |
| $this.SharedConstructor() | |
| } | |
| age([String]$CreationTime){ |
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
| [Parameter(Mandatory=$true, | |
| Position=0, | |
| ParameterSetName='P1')] | |
| [ValidatePattern("\w{2,5}")] | |
| [string] | |
| $Board, | |
| # Param2 help description | |
| [Parameter(Mandatory=$true, | |
| Position=1, |
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
| ## Global Values | |
| $pathSplitRegex = "[\\|/]" | |
| <# | |
| .Synopsis | |
| Short description | |
| .DESCRIPTION | |
| Long description | |
| .EXAMPLE |
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
| <# | |
| .Synopsis | |
| Short description | |
| .DESCRIPTION | |
| Long description | |
| .EXAMPLE | |
| Example of how to use this cmdlet | |
| .EXAMPLE | |
| Another example of how to use this cmdlet | |
| #> |
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 find-Projects { | |
| param( | |
| $root='D:\Repos', | |
| $depth = 5) | |
| $projectTypes = @(".git",".vscode") | |
| ## is this folder a project? | |
| if(ls $root -Directory -Name -Force | ? { $projectTypes -contains $_}) | |
| { |
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
| properties([ | |
| parameters([ | |
| string(name: 'DEPLOY_TEXT', defaultValue: 'defVal', description: '') | |
| ]) | |
| ]) | |
| echo "direct value: ${DEPLOY_TEXT}" | |
| echo "param value: ${params.DEPLOY_TEXT}" | |
| if(DEPLOY_TEXT == 'justin') { | |
| currentBuild.result = 'FAILURE' | |
| } |
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
| List folders = [ | |
| 'twelve-factor/Jenkinsfile', | |
| 'build-and-publish/Jenkinsfile', | |
| 'deploy-and-test/Jenkinsfile', | |
| 'deploy-with-redis/Jenkinsfile', | |
| 'locust-perf-test/Jenkinsfile', | |
| 'deploy-selenium-grid/Jenkinsfile', | |
| 'ami/Jenkinsfile' | |
| ] | |
| Map subJobs = [:] // name:closure |
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
| #ls -l from by-uuid | |
| lrwxrwxrwx. 1 root root 9 Apr 11 21:47 2018-11-25-21-21-31-00 -> ../../sr0 | |
| lrwxrwxrwx. 1 root root 10 Apr 11 21:47 6e22e4ee-b81c-48c3-a978-8a49b161786d -> ../../sdal | |
| lrwxrwxrwx. 1 root root 10 Apr 11 21:47 7984825e-cl5d-4707-a86d-67c4851388a9 -> ../../dm-2 | |
| lrwxrwxrwx. 1 root root 10 Apr 11 21:47 a866bb05-1b4d-49c4-9ca3-fdla4f111a0c -> ../../dm-1 | |
| lrwxrwxrwx. 1 root root 10 Apr 11 21:47 eee8e1b7-9e17-480-ade5-a24d4211c29d -> ../../dm-3 | |
| following these directions |
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
| $paths = foreach($c in $class){ | |
| $p = Join-Path $base (join-path $c "apps") | |
| foreach($a in $app){ | |
| $p = join-path $p $a | |
| foreach($e in $env){ | |
| Join-Path $p $e | |
| } | |
| } | |
| } |
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 Show-Object{ | |
| param( | |
| ## The object to examine | |
| [Parameter(ValueFromPipeline = $true)] | |
| $InputObject | |
| ) | |
| #custom controls for treeview... found it on MSDN a while ago, lost link :-/ | |
| [void][System.Reflection.Assembly]::LoadWithPartialName('presentationframework') |
NewerOlder