type: PIN
Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys
type: PIN
Consumer key: IQKbtAYlXLripLGPWd0HUA
#!/bin/zsh | |
:' | |
There is an apparent bug in dsconfigad for MacOS that will cause dsconfigad to arbitrarily | |
fail to bind to an existing computer record silently, even with the use of a force flag. | |
When this happens, disconfigad prompts for approval interactively. This causes JAMF to over | |
log the output to a tmp file that will eat all available harddisk space. This is particularly | |
problematic in environments using self-healing AD binding scripts. By introducing expect, | |
we can ensure that the y/n prompt is responded to or in the event of signficant network delay, | |
terminated after 60 seconds. This gist can be used as a template for how to use expect, but follow best |
Get-Process -pv p | ForEach-Object { | |
[PSCustomObject]@{ | |
Name = $p.name | |
ProcessHasDescription = $(if ($p.description) { $True }else { $False }) | |
Description = $(if ($p.description) { $p.Description } else { $null }) | |
} | |
} |
function f { | |
[Cmdletbinding()] | |
param([switch]$intervene) | |
begin{ | |
$abc = 123 | |
} | |
process{ | |
} | |
end{ |
class PSHashTable : Collections.Generic.Dictionary[string, string]{ | |
PSHashTable ([PSCustomObject]$Object) { | |
$Object.psobject.properties | ForEach-Object -Process {$this.add($_.name,$Object.($_.name))} | |
} | |
} | |
[HashTable][PSHashTable][PSCustomObject]@{Prop = "val"} |
function Get-MacOSCodeSign { | |
param ( | |
[parameter(Mandatory)] | |
[String]$AppPath | |
) | |
process { | |
$CodesignBundleID = (ConvertFrom-StringData -StringData $(codesign -dv $AppPath 2>&1 | Out-String)).identifier | |
$CodesignRequirement = (($(codesign -dr - $AppPath 2>&1) | Out-String) | Select-String "(?<=designated \=> ).*").matches.value |