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
#!/bin/bash | |
docker run --rm -it -v "$PWD:/app" -w /app -p 8000:80 mcr.microsoft.com/dotnet/sdk:6.0 dotnet $@ |
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
/* | |
Diff's a project's variables with the snapshot associated with its latest release | |
Need to include Octopus.Client nuget package | |
*/ | |
var server = "http://my-octopus-server/"; | |
var projectName = "my-project-name"; | |
// Util.SetPassword("Octopus key for " + server, null); // run this line to unsave the password (if it changes, or you stuff up the entry) | |
var apiKey = Util.GetPassword("Octopus key for " + server, false); | |
var endpoint = new Octopus.Client.OctopusServerEndpoint(server, apiKey); |
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
<Query Kind="Program"> | |
<Reference><RuntimeDirectory>\System.Windows.Forms.dll</Reference> | |
<NuGetReference>Rx-Main</NuGetReference> | |
<NuGetReference Prerelease="true">Microsoft.Diagnostics.Runtime</NuGetReference> | |
<Namespace>Microsoft.Diagnostics.Runtime</Namespace> | |
<Namespace>System.Reactive</Namespace> | |
<Namespace>System.Reactive.Linq</Namespace> | |
</Query> | |
//string sourceDump = @"C:\MyLocalData\piers.williams\Downloads\temp\xunit.dmp"; |
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
<# | |
.Synopsis | |
Generates a table-sync script, based on the current contents of a table | |
#> | |
param( | |
[Parameter(Mandatory=$true)] | |
$table, | |
$schema = 'Dim', | |
$database = 'ITS_DataMart', | |
$server = '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
let | |
Source = (StartDate as datetime, EndDate as datetime, Value as number) => | |
let | |
OverallDuration = EndDate - StartDate, | |
PerMinuteAllocation = Value / Duration.TotalMinutes(OverallDuration), | |
OneDay = #duration(1,0,0,0), | |
// Date that the overall window starts | |
d0 = DateTime.From(Date.From(StartDate)), |
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
# .synopsis | |
# Sees what Oracle .net driver is installed for x32 and x64 | |
# .author | |
# Piers | |
param( | |
$providerName = 'Oracle.DataAccess.Client' | |
) | |
$job = { | |
$providerName = $args[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
function Get-ADObject($adspath){ | |
$obj = new-object System.DirectoryServices.DirectoryEntry "LDAP://$adspath"; | |
new-object PSObject -Property:$obj.Properties; | |
} | |
function Find-ADUserByLogin($login){ | |
$ds = new-object System.DirectoryServices.DirectorySearcher | |
$ds.Filter = "(samAccountName=$login)"; | |
$result = $ds.FindOne(); | |
if($result){ |
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
/// Smartly unboxes a nullable value, with different semantics depending on the target type (nullable, option etc...) | |
let SmartUnbox<'a> isNull (value:obj) : 'a = | |
// help from from http://www.fssnip.net/hh | |
let targetType = typeof<'a> | |
let typeFlavour = TypeFlavour.Create<'a>() | |
match (isNull,typeFlavour) with | |
| true, ValueType -> failwithf "Can't return null for type %s" targetType.Name | |
| true, _ -> (box null) :?> 'a // cast null to nullable/option/reference type works fine! | |
| false, OptionT t -> | |
// Have to create the 'Some' member via reflection |
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
# Run this from Package Manager Console | |
# Make sure 'Default Project' is the one you want to update | |
# No refunds. YMMV | |
Select-Xml -Path:.\projectname\packages.config -xpath:'//package' | select-object -ExpandProperty:Node | % { Update-Package $_.Id -Version:$_.Version } |
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
<# | |
.Synopsis | |
General-purpose Octopus Deploy boostrapper | |
Binds Octopus variables directly on to parameters on an install script, passing the rest as a hashtable | |
This means your Install script can itself have 'proper' parameters, making local testing easier | |
#> | |
param( | |
$entryPoint = '.\Install.ps1' | |
) |
NewerOlder