Skip to content

Instantly share code, notes, and snippets.

@Stygy
Stygy / SetBuildNumber.ps1
Last active April 21, 2022 18:02
This powershell is being used as a Teamcity Build Step that sets the BuildNumber as Date.Counter (i.e 2018.02.02.1) and resets counter everyday. In collaboration with @axelwass
#$teamcityUser = '%teamcity.api.username%'
#$teamcityPass = '%teamcity.api.password%'
#$teamcityUrl = '%teamcity.api.url%'
[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12
$teamcityUser = '****'
$teamcityPass = '****'
$teamcityUrl = 'yadayada.com'
$buildId = '123456'
$projectId = 'ProjectId'
@Stygy
Stygy / GetNetFramework.ps1
Last active November 21, 2017 16:59
Powershell - Net Framework Versions
Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
Get-ItemProperty -name Version,Release -EA 0 |
Where { $_.PSChildName -match '^(?!S)\p{L}'} |
Select PSChildName, Version, Release, @{
name="Product"
expression={
switch -regex ($_.Release) {
"378389" { [Version]"4.5" }
"378675|378758" { [Version]"4.5.1" }
"379893" { [Version]"4.5.2" }