Skip to content

Instantly share code, notes, and snippets.

@corbob
corbob / why.ps1
Created March 10, 2018 23:20
why? But Why...
$licenses = Import-Csv $PSScriptRoot\LicenseCounts.csv
[Array]::Reverse($licenses)
$licenses = $licenses[0] | select *available*,*delta*
if($licenses.'E3 Available' -ge 25) {
write-output "E3 greater than or equal to 25: $($licenses.'E3 Available')"
$E3AvailableStyle = 'good'
} elseif ($licenses.'E3 Available' -ge 10 -and $licenses.'E3 Available' -lt 25) {
$E3AvailableStyle = 'caution'
} else {
[CmdletBinding()]
param
(
[Parameter(Mandatory = $True,
ValueFromPipeline = $True,
ValueFromPipelineByPropertyName = $True)]
[string[]]$AssetTag
)
BEGIN {
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@corbob
corbob / Podcasts.md
Last active July 16, 2018 04:31
List of podcasts
function Check-Help {
[CmdletBinding()]
param (
$Command
)
$CommandExists = $false
Try {
Get-Command $Command -ErrorAction Stop
$CommandExists = $true
} catch [System.Management.Automation.CommandNotFoundException] {
function Add-MyPhone {
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = 'Low')]
param (
[Parameter(Mandatory = $true)]
[string]
$PhoneName,
[Parameter(Mandatory = $true)]
[ValidateSet('Cisco 6941', 'Cisco 7841', 'Cisco 7942')]
[string]
$Product,
function test {
[CmdletBinding(SupportsShouldProcess)]
param()
$a = New-TemporaryFile
remove-item $a
}
@corbob
corbob / ci.ps1
Created January 12, 2019 05:43
install the last searched choco package
function ci {
$lastCommand = Get-History -Count 1
$newCommand = $lastCommand.CommandLine.Replace('clist','cinst').Replace('choco list','choco install')
Invoke-Expression $newCommand
}
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
opacity: 0.8,
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
I would like to turn this:
[ordered]@{
Envelope = [ordered]@{
Header = ''
Body = [ordered]@{
listPhone = [ordered]@{
searchCriteria = [ordered]@{
callingSearchSpaceName = '%'
}
returnedTags = [ordered]@{