This file contains hidden or 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
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"alignment": "left", | |
"segments": [ | |
{ | |
"background": "#C50F1F", | |
"foreground": "#FFFFFF", | |
"style": "powerline", |
This file contains hidden or 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
{ | |
"$help": "https://aka.ms/terminal-documentation", | |
"$schema": "https://aka.ms/terminal-profiles-schema", | |
"actions": | |
[ | |
{ | |
"command": | |
{ | |
"action": "copy", | |
"singleLine": false |
This file contains hidden or 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-RandomString { | |
param( | |
[Parameter()][ValidateRange(8, 4000)] | |
[int]$MaxLength = 16, | |
[Parameter()][ValidateRange(1,1000)] | |
[int]$MinCountLowerCaseLetters=1, | |
[Parameter()][ValidateRange(1,1000)] | |
[int]$MinCountUpperCaseLetters=1, | |
[Parameter()][ValidateRange(1,1000)] | |
[int]$MinCountDigits=1, |
This file contains hidden or 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
#Requires -Version 5 | |
#Requires -PSEdition Desktop | |
function Get-RootCAFromUrl { | |
[CmdletBinding()] | |
param( | |
# The uri of the website with the server certificate | |
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true)] | |
[ValidateNotNullOrEmpty()] | |
[uri] |
This file contains hidden or 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
//... | |
// in the DbContext -> protected override void OnModelCreating(ModelBuilder modelBuilder) | |
// orverride the property which is the key that should be incremented automatically | |
// - or do it for all the keys that need that | |
if (this.Database.IsSqlite()) | |
{ | |
// generally fix the sqlite composite primary key auto increment issue | |
// see https://github.com/dotnet/efcore/issues/15497 |
This file contains hidden or 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
{ | |
"editor.insertSpaces": true, | |
"editor.useTabStops": false, | |
"editor.detectIndentation": false, | |
"editor.renderWhitespace": "all", | |
"editor.tabSize": 2, | |
"editor.roundedSelection": true, | |
"editor.trimAutoWhitespace": true, | |
"editor.renderIndentGuides": true, | |
"editor.formatOnSave": true, |
This file contains hidden or 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
[user] | |
name = Martin Hudasch | |
email = [email protected] | |
[push] | |
default = simple | |
[alias] | |
list-aliases = !git config --list | grep ^alias\\. | cut -c 7- | grep -Ei --color \"$1\" "#" | |
aliases = list-aliases | |
la = list-aliases | |
st = status |
This file contains hidden or 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
Get-Process | Group-Object -Property ProcessName | ForEach-Object { | |
$_ | Add-Member -MemberType NoteProperty -Name "ComputerName" -Value $env:ComputerName -Force; | |
$_ | Add-Member -MemberType NoteProperty -Name "MemoryUsageKB" -Value (($_.Group|Measure-Object WorkingSet -Sum).Sum / 1KB); | |
$_ | Add-Member -MemberType NoteProperty -Name "MemoryPercentageOnTotal" -Value ((100/(Get-CimInstance -ClassName "CIM_OperatingSystem" -Namespace "root/CIMv2").TotalVisibleMemorySize) * (($_.Group|Measure-Object WorkingSet -Sum).Sum / 1KB)); | |
$_; | |
} | Sort-Object -Descending -Property "MemoryUsageKB" | | |
Select-Object -First 5 | | |
Format-Table -Property "ComputerName","Name", @{n='Mem (KB)';e={'{0:N0}' -f $_.MemoryUsageKB};a='right'}, @{n='% on total';e={'{0:N2}%' -f $_.MemoryPercentageOnTotal};a='right'} |
This file contains hidden or 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
######################################## | |
## Initial data collection inside the host | |
######################################## | |
$OutputEncoding = [System.Text.Encoding]::Default; | |
[Console]::OutputEncoding = $OutputEncoding; | |
$InformationPreference = "Continue"; | |
if ($([System.Environment]::GetCommandLineArgs() -join " ") -inotmatch "(?i)-(?:nologo|noniteractive|noecho)" -and | |
($([System.Environment]::GetCommandLineArgs() -join " ") -inotmatch "(?i)-command" -or | |
($([System.Environment]::GetCommandLineArgs() -join " ") -imatch "(?i)-command" -and $([System.Environment]::GetCommandLineArgs() -join " ") -inotmatch ('(?i)\' + $([io.path]::DirectorySeparatorChar) + '(?i)\\(?:.*?(?<!shellIntegration|hr))\.ps1')))) { |
This file contains hidden or 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
$packagesPath = (Join-Path -Path $WorkingDirectory -ChildPath "packages"); | |
if (Test-Path -Path $packagesPath) { | |
Write-Verbose -Message "Fixing packages folder structure..."; | |
$restoredVersionedPackagePaths = @(Get-ChildItem -Path $packagesPath -Directory | | |
Select-Object -ExpandProperty "FullName" | | |
ForEach-Object { | |
$path = $_; | |
$versionedMatch = [regex]::Match($path, ".*?\\(?<path>packages\\(?<id>.*?)\.(?<version>\d+(?:\.\d+)+))"); | |
if (!$versionedMatch.Success) { | |
return; |
NewerOlder