Skip to content

Instantly share code, notes, and snippets.

View bergmeister's full-sized avatar

Christoph Bergmeister bergmeister

View GitHub Profile
@powercode
powercode / ImportCsvWithType.ps1
Last active March 11, 2025 10:27
Automatic generation of a class to store data from import-csv
function New-TypeDefinitionFromCsv {
param(
[Parameter(Mandatory)]
[string] $Path,
[ValidatePattern("\w[\w\d_-]*", ErrorMessage = "The typename must be a valid name of an Identifier.")]
[string] $NameOfGeneratedType,
[ArgumentCompletions('";"', '"`t"', '","')]
[string] $Delimiter = ',',
[Type[]] $ColumnType,
[switch] $CSharp
@brettmillerb
brettmillerb / OBSSetup.md
Last active March 13, 2019 19:48
Setting up OBS

OBS Configuration

  • Download and install OBS from OBS Download
  • Disable Hardware Acceleration in Chrome
    - Open Chrome
    - Settings
    - Search for Hardware Acceleration
    - Turn off 'Use hardware acceleration when available'
    - Relaunch Chrome
    
@Jaykul
Jaykul / Start-Demo.ps1
Last active December 2, 2022 08:55
Doing demos with just PSReadLine
function Start-Demo {
[CmdletBinding()]
param(
# A history file with a command on each line (or using ` as a line-continuation character)
[Parameter(Mandatory)]
[Alias("PSPath")]
[string]$Path
)
[Microsoft.PowerShell.PSConsoleReadLine]::ClearHistory()
@indented-automation
indented-automation / Update-PesterTest.ps1
Last active October 4, 2021 18:17
Migrating to Pester 4.0.7
function Update-PesterTest {
[CmdletBinding()]
param (
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[Alias('FullName')]
[String]$Path
)
begin {
$shouldParams = [String[]](Get-Command Should).Parameters.Keys
@jchandra74
jchandra74 / PowerShell Customization.md
Last active December 25, 2025 13:11
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

foreach($level in "Machine","User") {
[Environment]::GetEnvironmentVariables($level).GetEnumerator() | % {
# For Path variables, append the new values, if they're not already in there
if($_.Name -match 'Path$') {
$_.Value = ($((Get-Content "Env:$($_.Name)") + ";$($_.Value)") -split ';' | Select -unique) -join ';'
}
$_
} | Set-Content -Path { "Env:$($_.Name)" }
}
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream