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
## ScriptTest.ps1 | |
Write-Host "InvocationName:" $MyInvocation.InvocationName | |
Write-Host "Path:" $MyInvocation.MyCommand.Path |
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
#please read the NSSM https://nssm.cc/usage | |
Function Install-Service { | |
param( | |
[Parameter(Mandatory=$true)][string]$NSSMPath, | |
[Parameter(Mandatory=$true)][string]$serviceName , | |
[Parameter(Mandatory=$true)][string]$serviceExecutable , | |
[Parameter(Mandatory=$false)][string]$serviceExecutableArgs , | |
[Parameter(Mandatory=$false)][string]$serviceAppDirectory , | |
[Parameter(Mandatory=$true)][string]$serviceErrorLogFile , | |
[Parameter(Mandatory=$true)][string]$serviceOutputLogFile , |
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
Write-host Preparing version file | |
$version="1.0.0" | |
$json = @" | |
{ | |
"version": "$version", | |
"timestamp": "$(Get-Date)" | |
} | |
"@ | |
[System.IO.File]::WriteAllLines("version.json", $json) |
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
$path = "c:\Users\"+[Environment]::UserName+"\.dnx\packages" | |
write-host $path | |
function GetDirs($path = $pwd, [Byte]$ToDepth = 255, [Byte]$CurrentDepth = 0) | |
{ | |
$CurrentDepth++ | |
If ($CurrentDepth -le $ToDepth) { | |
foreach ($item in Get-ChildItem $path) | |
{ | |
if (Test-Path $item.FullName -PathType Container) |
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
class ResourceHelper | |
{ | |
public static string GetScriptFromResources(string resourceName) | |
{ | |
var assembly = Assembly.GetExecutingAssembly(); | |
string scriptBody = null; | |
//lists all the embedded resources | |
//var resources = assembly.GetManifestResourceNames(); |
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
$rootDirectory="%teamcity.build.workingDir%" | |
$gitHash="%build.vcs.number%" | |
echo "githash is $gitHash" | |
$gitShortHash=$gitHash.Substring(0,7) | |
$listOfFiles = @( | |
"$rootDirectory\src\TestProject\project.json" | |
) | |
foreach($file in $listOfFiles) |
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
$githubHash="%build.vcs.number%" | |
$gitShortHash=$githubHash.Substring(0,7) | |
$rootDirectory="%teamcity.build.workingDir%" | |
$listOfFiles = @( | |
"$rootDirectory\TestProject\Properties\AssemblyInfo.cs" | |
) | |
foreach($file in $listOfFiles) | |
{ |
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
Get-ChildItem -Path "%teamcity.build.workingDir%" -Filter *.pdb -Recurse|Remove-Item -force |
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
class Program | |
{ | |
public class CityTemps | |
{ | |
public string City { get; set; } | |
public string Year { get; set; } | |
public double Temp { get; set; } | |
} | |
static void Main(string[] args) |
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
Param( | |
[Parameter(Mandatory=$true)][string]$sourceDirectory, | |
[Parameter(Mandatory=$true)][string]$outputFile | |
) | |
#$sourceDirectory = "c:\temp\container-builder\" | |
#$outputFile = "c:\temp\container.txt" | |
$files= Get-ChildItem $sourceDirectory -Filter *.dll |