Skip to content

Instantly share code, notes, and snippets.

View jhoneill's full-sized avatar

James O'Neill jhoneill

View GitHub Profile
@jhoneill
jhoneill / Remove-SoftDeletedAPIService.ps1
Last active July 14, 2021 08:07
Re-deploying the API management service fails and help says call the REST API: here's a script to do it.
<#
.synopsis
Remove Soft-deleted API Management service
.description
Re-deploying the API management service fails with a message
See https://aka.ms/apimsoftdelete
That says call the REST API. This does that.
#>
[cmdletbinding(SupportsShouldProcess=$true,confirmImpact='High' )]
param (
@jhoneill
jhoneill / demo.ps1
Last active February 15, 2022 08:17
# rev 0.2 added more comments, and made the regax a bit more precise.
function SplitEmUp {
param (
$paramString
)
#This regex will isolate quoted blocks e.g. " -example )( $quote "
# and will identify matching open and close () {} and [] even if nested.
$opensAndCloses = @'
(?x) # Allow comments and ignore spaces and line breaks in the layaout.
^(?> # Start and make the repeating group ‘atomic’.
#I created this to show how much there is on the MS Graph API.
#I pulled down the openapi (nee swagger) files for Users, users.actions, Users,functions and groups
#And using my https://github.com/jhoneill/PSGraph - my version of Kevin Marquette's graphViz Module
#this litte bit of script produced a graphical version
$paths = @()
$ParentHash = @{}
function hasParent {
# .synopsis if the parent isn't in the call recursively with the parent. Add item and its parent to the hash
param($path)
@jhoneill
jhoneill / Show-help.ps1
Created February 4, 2021 17:48
A PowerShell Productivity hack - put help in it's own window
function Show-Help {
<#
.Synopsis
Open help in "Show window" mode
#>
param (
[parameter(ValueFromPipeline=$true)]
[ArgumentCompleter({
param($commandName, $parameterName,$wordToComplete,$commandAst,$fakeBoundParameter)
[System.Management.Automation.CompletionCompleters]::CompleteCommand($wordToComplete)
@jhoneill
jhoneill / localhost.ipynb
Last active November 23, 2020 12:12
Demo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jhoneill
jhoneill / PowerShellNotebookModule.ipynb
Last active November 23, 2020 18:06
Changes I made to the module
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jhoneill
jhoneill / GetSql.ipynb
Created November 20, 2020 18:20
Accessing data with the GetSQL module
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jhoneill
jhoneill / Chrome Databases.ipynb
Last active June 6, 2025 07:50
Exploring data saved by Chrome/Edge/Any Chromium (passwords done in another Gist)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jhoneill
jhoneill / lightroom.ps1
Created April 18, 2020 11:54
PowerShell Script to explore Adobe Lightroom catalogs
##########################################################
# #
# Tools for getting information from the Lightroom DB #
# To use this script you need to download the SQL Lite #
# ODBC driver from http://www.ch-werner.de/sqliteodbc/ #
# #
# and set your default catlog path #
# #
##########################################################
@jhoneill
jhoneill / Copy-Spotlight.ps1
Last active November 20, 2020 22:05
This script copies files downloaded by windows spotlight. For years I have had Windows background drawn from users\public\pictures\sample pictures, so this adds the spotlight ones to that location by default.
<#
.Synopsis
Copies images downloaded by Windows Spotlight
#>
[cmdletbinding()]
param (
#Where to send JPEGS which are Landscape format e.g ~\AppData\Roaming\Microsoft\Teams\Backgrounds\Uploads
$LandScapeDestination = "C:\users\Public\Pictures\Sample Pictures",
#Where to send JPEGS which are portrait format
$PortraitDestination = "C:\Users\Public\Pictures\Portrait Samples"