Skip to content

Instantly share code, notes, and snippets.

@pawelpabich
pawelpabich / Function.cs
Last active October 16, 2019 04:21
Stateless function
#Defintion
public static class SetServerUrl
{
public static Task Run(paramters)
{
//Body
}
}
param([string] $VirtualMachineFullDNSName, [string] $ConnectionString, [string] $AdministratorPassword, [string] $EncodedLicense, [string] $StoragePath, [string] $InstanceName, [Int] $ServerCommPort)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest;
function Log($Message)
{
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss,fff"
$newLine = [System.Environment]::NewLine
$logEntry = "$timestamp $Message $newLine"
param([string] $Version, [string] $StorageAccount, [string] $StorageUser, [string] $StoragePassword)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest;
New-Item -ItemType Directory -Force -Path C:\Temp
function Log($Message)
{
$timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss,fff"
param([string] $IpAddress, [string] $ConnectionString, [string] $AdministratorPassword, [string] $EncodedLicense, [string] $StoragePath, [string] $StorageAccount, [string] $StorageUser, [string] $StoragePassword)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest;
function Log($Message, $IncludeTimestamp)
{
$logEntry = $Message
if ($IncludeTimestamp)
=====================
18/05/2018 9:44:40 AM
LimitedFunctionality
System.AggregateException: Project system data flow 'OutputGroupsService Outer 84518' closed because of an exception: System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.VisualStudio.ProjectServices.DesignTimeBuilder.<BuildAsync>d__17.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNot
function FindProxyForURL(url, host)
{
return "PROXY localhost:8888";
}
@pawelpabich
pawelpabich / Get-Events.ps1
Last active March 23, 2017 11:33
Gets events related to variable sets
param($OctopusServerUrl, $OctopusServerApiKey, $OutputFile, $DateFrom, $DateTo)
$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest;
$Server = @{ OctopusServerUrl = $OctopusServerUrl; OctopusServerApiKey = $OctopusServerApiKey}
function Get-Data($Path)
{
$Path = $Path.Replace("api/", "")
UPDATE [dbo].[Deployment]
SET JSON = REPLACE(JSON, '"$type":"Octopus.Server.Orchestration.Deploy.DeploymentState, Octopus.Server",','')
WHERE JSON LIKE '%"$type":"Octopus.Server.Orchestration.Deploy.DeploymentState, Octopus.Server",%'
GO

Keybase proof

I hereby claim:

  • I am pawelpabich on github.
  • I am pawelpabich (https://keybase.io/pawelpabich) on keybase.
  • I have a public key whose fingerprint is 112D 7AE2 27E4 1D5D 690E 79C4 8418 0402 7F37 D6A3

To claim this, I am signing this object:

let value =
match "MyVariableName" |> Octopus.tryFindVariable with
| Some x -> x
| None -> "not available"
printfn "Hello %s" value