Skip to content

Instantly share code, notes, and snippets.

View compwiz32's full-sized avatar

Mike Kanakos compwiz32

View GitHub Profile
@jdhitsolutions
jdhitsolutions / Send-MastodonPost.ps1
Created December 21, 2022 20:19
A PowerShell function to post a Mastodon status.
#requires -version 5.1
<#
Based on a function from https://gist.github.com/dhmacher/2203582502c7ab13015db8f52e94da45
You need an access token that has at least write access to your status
* go to settings -> Development
* Click "New Application"
* Enter a name

Credit: Mark Kraus
Website: https://get-powershellblog.blogspot.com

Collection Type Guidence

When to use what

  • Use Arrays if you know the element types and have a fixed length and/or known-up-front collection size that will not change.
  • Use ArrayList if you have an unkown collection size with either unknown or mixed type elements.
  • Use a Generic List when know the type of the elements but not the size of the collection.
  • Use a HashTable if you are going to do key based lookups on a collection and don't know the object type of the elements.
  • Use a Dictionary<TKey, TValue> you are going to do key based lookups on a collection and you know the type of the elements.
  • Use a HashSet when you know the type of elements and just want unique values and quick lookups and assignmnets.
@rkeithhill
rkeithhill / powershell.json
Last active February 23, 2024 23:18
PowerShell snippets file for Visual Studio Code - place in your ~\AppData\Roaming\Code\User\Snippets directory
{
"Condition statement": {
"prefix": "cond",
"body": [
"$1 { $0; break }"
],
"description": "Switch condition statement"
},
"Condition single quoted string statement": {
"prefix": "condsqstr",