I hereby claim:
- I am Xplantefeve on github.
- I am xplantefeve (https://keybase.io/xplantefeve) on keybase.
- I have a public key whose fingerprint is BBA5 AAF0 DC6E 481C 091E A57D 8230 1914 C28F 3C6E
To claim this, I am signing this object:
<# | |
.Synopsis | |
Gets computer info from SCCM | |
.DESCRIPTION | |
Retrieves computers from SCCM, with optional targeting and filtering | |
.INPUTS | |
[System.String] | |
.OUTPUTS | |
[System.Management.ManagementObject#root\sms\site_SCM\SMS_R_System] | |
.EXAMPLE |
# Answer to http://powershell.org/wp/2016/03/05/2016-march-scripting-games-puzzle/ | |
Function Get-HumanReadableSize($size) { | |
If ( $size -lt 1KB) { Return $size } | |
ElseIf ( $size -lt 1MB) { Return "$([math]::Round(($size / 1KB),2))Kb" } | |
ElseIf ( $size -lt 1GB) { Return "$([math]::Round(($size / 1MB),2))Mb" } | |
ElseIf ( $size -lt 1TB) { Return "$([math]::Round(($size / 1MB),2))Gb" } | |
Else { Return "$([math]::Round(($size / 1TB),2)) TB" } | |
} |
I hereby claim:
To claim this, I am signing this object:
<# | |
.Synopsis | |
Short description | |
.DESCRIPTION | |
Long description | |
.EXAMPLE | |
Example of how to use this cmdlet | |
.EXAMPLE | |
Another example of how to use this cmdlet | |
#> |
<# | |
.Synopsis | |
Gets uptime information | |
.EXAMPLE | |
Get-Uptime -ComputerName URANUS | |
.INPUTS | |
String[] | |
.OUTPUTS | |
CUSTOM.UptimeInfo | |
.NOTES |
<# | |
.Synopsis | |
Creates a timer with display | |
.DESCRIPTION | |
Creates a timer that writes the progress of the current action and the estimated remaining time. | |
Suppose you have $Items, an array of items to process. | |
First, you create a timer initialized to the number of items in the array: | |
$MyTimer = New-Timer -TotalItems $Items.count -Activity 'Processing items' |
<# | |
MIT License | |
Copyright (c) 2016 Xavier Plantefeve | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is |
#region ExcelFunctions | |
function Get-NormalizedPath ( $Path ) { | |
if ( ( Split-Path $Path ) -match '^(\.|)$' ) { | |
$Path = Join-Path -Path ( Get-Location ) -ChildPath ( Split-Path -Path $Path -Leaf ) | |
} | |
return $Path | |
} | |
$MethodImportCSVtoSheet = { |
$domainControllers = Get-ADDomainController -Filter * | |
Get-ADGroupMember -Identity 'Domain Admins' -Recursive | ForEach-Object -Process { | |
$user = $_ | |
$domainControllers | | |
ForEach-Object -Process { | |
Get-ADUser $user.SamAccountName -Server $_.Name -Properties lastLogon, cn, employeeNumber, accountExpires, PasswordNeverExpires, Enabled, LockedOut, pwdLastSet | |
} | | |
Sort-Object -Property LastLogon | | |
Select-Object -Last 1 -Property SamAccountName, |
Topic: NBA All Stars | |
Owners: Foo Owners | |
Users: User 1 | |
Users: User 2 | |
Topic: NFL MVPs | |
Owners: Bar Owners | |
Users: Tony Stark | |
Users: Mitch Hedberg | |
Users: Someone Else | |
Topic: NBA MVPs |