Skip to content

Instantly share code, notes, and snippets.

@sowderca
sowderca / Get ticket
Created April 3, 2019 21:53
connectwise
s (51 sloc) 2.49 KB
RawBlameHistory
use AppleScript version "2.5"
use scripting additions
use framework "Foundation"
property |NSURL| : a reference to current application's |NSURL|
property NSString : a reference to current application's NSString
property NSURLSession : a reference to current application's NSURLSession
@sowderca
sowderca / fs.reg
Last active November 19, 2019 18:56
[HKEY_LOCAL_MACHINE\SOFTWARE\FSLogix\Profiles]
@sowderca
sowderca / ssb-interop.bundle.js
Created July 18, 2019 13:08
/Applications/Slack.app/Contents/Resources/app/dist/
This file has been truncated, but you can view the full file.
module.exports = function(modules) {
var installedModules = {};
function __webpack_require__(moduleId) {
if (installedModules[moduleId]) return installedModules[moduleId].exports;
var module = installedModules[moduleId] = {
i: moduleId,
l: !1,
exports: {}
};
@sowderca
sowderca / run.ps1
Created November 17, 2020 16:51
uni test helper
#!/usr/bin/env pwsh
#Requires -Version 5.0
#Requires -Module Pester, Microsoft.PowerShell.Management, Microsoft.PowerShell.Utility
using namespace System;
using namespace System.IO;
[CmdletBinding()]
param(
#!/usr/bin/env pwsh
using namespace System;
[CmdletBinding()]
param(
[string] $ModuleName = $env:MODULE_NAME,
[string[]] $RequiredModules = $env:REQUIRED_MODULES,
[string] $BuildVersion = $env:BUILD_VERSION
);
@sowderca
sowderca / script.ps1
Last active March 5, 2021 18:28
flat directory file dependency solution
#!/usr/bin/env pwsh
#Requires -Version 7
param([string] $path);
Push-Location -Path $path;
function order([string] $Path) {
[Collections.Stack] $stack = [Collections.Stack]::new();
foreach ($file in (Get-ChildItem -Path $Path -Filter '*.txt')) {
[void] $stack.Push($file.Name);
$file | Get-Content | ForEach-Object {
[string]::IsNullOrEmpty($_) ? (&{return}) : (order($_));
@sowderca
sowderca / script.ps1
Created May 17, 2021 21:14
local admins
Get-CimInstance -ComputerName $ComputerName -Namespace 'root/cimv2' -QueryDialect 'WQL' -Query "associators of {Win32_Group.Domain='$($ComputerName)',Name='Administrators'} where Role=GroupComponent";
Code:
init:
#NoEnv
#SingleInstance, Force
#Persistent
#InstallKeybdHook
#UseHook
#KeyHistory, 0
#HotKeyInterval 1
#MaxHotkeysPerInterval 127
@sowderca
sowderca / gist:83c8e44434a2d9dea33eef96fb4a0b76
Created January 18, 2022 20:29
Exclude based upon attribute
Get-ChildItem -Path './src' -Filter '*.ps1' -File -Recurse | ForEach-Object {
$functions = (Get-Command $_.FullName).ScriptBlock.Ast.FindAll( { $args[0] -is [System.Management.Automation.Language.FunctionDefinitionAst] }, $false);
foreach ($func in $functions) {
[ScriptBlock] $code = [ScriptBlock]::Create("function tmp-$($func.Name) $($func.Body)");
New-Module -Name 'tmp-mod' -ScriptBlock $code | Out-Null;
[PSCustomObject] @{
File = $_.Name;
Function = $func.Name;
Attributes = (Get-Command -Name "tmp-$($func.Name)").ScriptBlock.Attributes | % { ${PSItem}?.TypeId?.Name }
};
<wsdl:definitions
targetNamespace="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"
xmlns:cfg="http://schemas.microsoft.com/wbem/wsman/1/config"
xmlns:wsmanfault="http://schemas.microsoft.com/wbem/wsman/1/wsmanfault"
xmlns:wsman="http://schemas.dmtf.org/wbem/wsman/1/wsman.xsd"
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wst="http://schemas.xmlsoap.org/ws/2004/09/transfer"
xmlns:wse="http://schemas.xmlsoap.org/ws/2004/08/eventing"
xmlns:wsen="http://schemas.xmlsoap.org/ws/2004/09/enumeration"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"