Skip to content

Instantly share code, notes, and snippets.

@rdelrosario
rdelrosario / app_notarizer.sh
Last active January 12, 2024 19:40
macOS Application Notarization Script
#!/bin/bash
usage()
{
# Display Help
echo "*********************************************************************************************************************************************************"
echo " MacOS Application Notarization Script"
echo "*********************************************************************************************************************************************************"
echo
@bgelens
bgelens / Convert-PesterResultToJUnitXml.ps1
Created August 13, 2019 05:47
GitLab does not support NUnitXml as provided by Pester. Instead, it supports JUnitXml. This helper function takes the Pester output and generates a JUnitXml from it to be consumed by GitLab pipelines
function Convert-PesterResultToJUnitXml {
[CmdletBinding()]
param (
[Parameter(Mandatory)]
$PesterResult
)
$junit = '<?xml version="1.0" encoding="utf-8"?>'
$junit += "`n" + '<testsuites name="Pester" tests="{0}" failures="{1}" disabled="{2}" time="{3}">' -f @(
$PesterResult.TotalCount,
@VladRez
VladRez / powershell-media-duration.ps1
Created April 16, 2019 21:30
Display video/audio length in powershell
$Folder = 'C:\path\to\media\';
$sec = 0
$min = 0
$hr = 0
$len = @()
Get-ChildItem -Recurse | ForEach-Object {
$File = $_.Name;
@Syfaro
Syfaro / dragon_download.py
Last active May 14, 2025 03:09
Download OBJ previews of products from Bad Dragon
from typing import List, Iterator
import os
import urllib.request
import json
from dataclasses import dataclass
import argparse
PRODUCT_URL = "https://bad-dragon.com/api/products"
SAVE_DIR = "models"
@marcgeld
marcgeld / psRandomAlphaNumeric.ps1
Created April 5, 2017 13:05
Powershell: Generate a random Alphanumeric string
# Generate a random Alphanumeric string
Function Get-RandomAlphanumericString {
[CmdletBinding()]
Param (
[int] $length = 8
)
Begin{
@jdhitsolutions
jdhitsolutions / Check-ModuleUpdate.ps1
Last active May 30, 2023 11:17
Test installed PowerShell modules against online versions in the PowerShell Gallery.
[cmdletbinding()]
[outputtype("moduleInfo")]
Param(
[Parameter(Position = 0, HelpMessage = "Enter a module name or names. Wildcards are allowed.")]
[ValidateNotNullorEmpty()]
[string[]]$Name = "*"
)
Write-Verbose "Getting installed modules"
Try {
@Average-Bear
Average-Bear / Profile_v2-8.ps1
Last active September 26, 2022 06:19
PowerShell Profile JBear
$ProVersion = "v2.8"
<#
PowerShell Profile $ProVersion
Author: Jeremy DeWitt aka JBear
Update Notes:
Version 2.8:
- Added Windows 7 and MSOffice 2013 activation functions to repo.
@DavidRogersDev
DavidRogersDev / Get-Bing.ps1
Last active November 26, 2023 10:34
Powershell script which downloads the Bing image of the day.
$today = Get-Date
$todayFormatted = $today.Year.ToString() + "-" + $today.Month.ToString("D2") + "-" + $today.Day.ToString("D2")
$Market = "en-AU"
$Resolution = "1920x1200"
$ImageFileName = "wallpaper-" + $todayFormatted + ".jpg"
$DownloadDirectory = "$env:USERPROFILE\Pictures\Bing Wallpaper"
$BingImageFullPath = "$($DownloadDirectory)\$($ImageFileName)"
if ((Test-Path $DownloadDirectory) -ne $True) {
@jbilinski
jbilinski / copy-dns-from-pfsense-unbound-to-windows-1.ps1
Last active October 8, 2019 04:42
copy-dns-from-pfsense-unbound-to-windows
#requires -Version 4.0 -Modules DnsServer
<#
.Synopsis
Copy Unbound DNS records from pfSense to MS DNS server
.DESCRIPTION
Facilitates movement from Unbound on pfSense to MS DNS services.
Function recreates A and CNAME records from pfSense backup in a MS Server DNS zone.
*Tested with pfSense version 2.3.2 and Server 2016
@cdhunt
cdhunt / Get-CredentialFromWindowsCredentialManager.ps1
Last active September 4, 2024 19:46 — forked from toburger/Get-CredentialFromWindowsCredentialManager.ps1
Gets a PowerShell Credential [PSCredential] from the Windows Credential Manager. This only works for Generic Credentials.
<#
.SYNOPSIS
Gets a PowerShell Credential (PSCredential) from the Windows Credential Manager
.DESCRIPTION
This module will return a [PSCredential] object from a credential stored in Windows Credential Manager. The
Get-StoredCredential function can only access Generic Credentials.
Alias: GSC