Skip to content

Instantly share code, notes, and snippets.

View fatherjack's full-sized avatar
💭
doing things

fatherjack

💭
doing things
View GitHub Profile
@fatherjack
fatherjack / New-QuotedString.ps1
Created February 28, 2022 11:39
Creates a quoted, comma separated list of values
function New-QuotedString {
<#
.SYNOPSIS
Takes a pasted set of cells from Excel and returns a quoted, comma separated string that can be pasted into SSMS for a SQL filter
.DESCRIPTION
Long description
.PARAMETER ItemsList
# Set $Source to be the path to the xlsx to process
#requires -module ImportExcel
# cleans Excel column headers from having leading / trailing spaces and replaces other spaces with underscore '_'
# and then uses this set of headers to import data from the xlsx with headers that are easier to handle in code.
# Essentially lines 8-14 are extra to a normal use of Import-Excel and the import line uses the header info and -StartRow to skip the file headers
# the target xlsx remains unchanged
$h = Import-Excel $source -StartRow 1 -EndRow 2
$headers = ($h | Get-Member -MemberType Properties | ForEach-Object {
function Format-QuotedString {
<#
.SYNOPSIS
Wraps a string in delimiters
.DESCRIPTION
Takes in a string, returns the same string wrapped in chosen delimiters. Made to fill a similar role as the TSQL QUOTENAME function.
.PARAMETER String
The string you want wrapped
@fatherjack
fatherjack / OnPremisesProbably.txt
Created February 7, 2024 14:35
Do you mean 'on premise' or 'on premises' ?
Premise
A premise is an idea or theory on which a statement or action is based. For example, in the argument “All humans are mortal; Socrates is human; therefore, Socrates is mortal”, the first two statements are premises and the last one is the conclusion. Premise can also be used as a verb, meaning to base a theory, argument, etc. on an idea, thought, or belief. For example, “He premised his argument on several incorrect assumptions”.
[source Microsoft Copilot "define Premise" Feb 2024]
Premises
Premises is a plural noun that means the land and buildings owned by someone, especially by a company or organization. It can also mean the land and buildings on which something is done or used, such as a business, a school, or a restaurant. For example, “The company is relocating to new premises” or “There is no smoking allowed anywhere on school premises”
[source Microsoft Copilot "define Premises" Feb 2024]