Skip to content

Instantly share code, notes, and snippets.

@jschpp
jschpp / Dockerfile
Last active February 22, 2021 22:32
.Net + Powershell + Jupyter = ❤️
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster
RUN apt-get update && apt-get install python3 python3-pip -y
RUN pip3 install jupyterlab
RUN dotnet tool install -g --add-source "https://dotnet.myget.org/F/dotnet-try/api/v3/index.json" Microsoft.dotnet-interactive
ENV PATH="/root/.dotnet/tools:${PATH}"
RUN dotnet interactive jupyter install

Credit: Mark Kraus
Website: https://get-powershellblog.blogspot.com

Collection Type Guidence

When to use what

  • Use Arrays if you know the element types and have a fixed length and/or known-up-front collection size that will not change.
  • Use ArrayList if you have an unkown collection size with either unknown or mixed type elements.
  • Use a Generic List when know the type of the elements but not the size of the collection.
  • Use a HashTable if you are going to do key based lookups on a collection and don't know the object type of the elements.
  • Use a Dictionary<TKey, TValue> you are going to do key based lookups on a collection and you know the type of the elements.
  • Use a HashSet when you know the type of elements and just want unique values and quick lookups and assignmnets.
@bielawb
bielawb / ValidateSet.Tests.ps1
Created November 1, 2016 19:10
Pester test for ValidateSet
function foo {
param (
[ValidateSet(
'this',
'that'
)]
[String]$bar
)
}