Skip to content

Instantly share code, notes, and snippets.

# do not convert column of numbers, autosize the column width
export-excel -NoNumberConversion columnname -AutoSize
@joppegabbe
joppegabbe / set.ps1
Last active February 3, 2023 10:49
union intersection setdifference in powershell
$a = (1,2,3,4)
$b = (1,3,4,5)
$a + $b | select -uniq #union
$a | ?{$b -contains $_} #intersection
# ===========================
#For set subtraction (a - b):
$a | ?{-not ($b -contains $_)}
@joppegabbe
joppegabbe / ShowObjectGraph.ps1
Created June 5, 2019 19:02 — forked from sean-m/ShowObjectGraph.ps1
Displays structure of an object/collection in a WPF TreeView.
function Show-ObjectGraph {
[Alias('sog')]
<#
.Synopsis
Displays structure of an object/collection in a WPF TreeView.
.DESCRIPTION
Recursively builds out an object graph which is then set to
the DataContext of a WPF TreeView. This will display all type and
member info for the object or collection elements. This is a blocking
operation.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.