Skip to content

Instantly share code, notes, and snippets.

@hbulens
hbulens / compressimages.ps1
Created Dec 5, 2022
Recursive compress images using imagemagick
View compressimages.ps1
param(
[Parameter(Mandatory=$true)]
[String]$path
)
Get-ChildItem –Path $path –Recurse -Include *.png,*.jpg,*.bmp | Foreach-Object {
magick $_.FullName -strip -interlace Plane -gaussian-blur 0.05 -quality 85% $_.FullName
}
@hbulens
hbulens / remove-pipeline.ps1
Created Oct 19, 2022
Remove Azure DevOps pipeline
View remove-pipeline.ps1
#Azure DevOps Personal Access Token
# https://learn.microsoft.com/en-us/azure/devops/organizations/accounts/use-personal-access-tokens-to-authenticate?view=azure-devops&tabs=Windows
# Courtesy of https://stackoverflow.com/questions/66264466/how-can-i-delete-azure-devops-old-build-pipelines-and-there-leases-with-power-sh
$personalAccessToken = "<Enter your personal access token here>"
$token = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes(":$($personalAccessToken)"))
$header = @{authorization = "Basic $token"}
$organization = "<Enter your Azure DevOps Organization here>"
$project = "<Enter your Project Name here>"
View README.md
  • Download the latest license file from SharePoint: 🧭 Documents -> Licenties -> BC -> BC.flf
  • Open BC Powershell and run update-bc-license.ps1
@hbulens
hbulens / README.md
Last active Dec 16, 2021
Creates a new user in Dime.Scheduler
View README.md

About

Unofficial script to create a Dime.Scheduler user. Check the Dime.Scheduler CLI for the official and supported way to provision users.

Example

New-Dime.SchedulerUser `
-DisplayName "Name of the user" `
-EmailAddress "user@email.com" `
-Language en `
-TimeZone "Europe/London" `
@hbulens
hbulens / docker-compose.yml
Last active Aug 12, 2021
Create Wordpress Docker container
View docker-compose.yml
version: "3"
services:
mywordpress:
image: wordpress
environment:
WORDPRESS_DB_HOST: "mydatabase"
WORDPRESS_DB_NAME: "wordpress_db"
WORDPRESS_DB_USER: "wordpress_user"
WORDPRESS_DB_PASSWORD: "my-secret-wordpress-pw"
ports:
@hbulens
hbulens / install-sqlserverexpress.ps1
Created Jun 16, 2021
Installs SQL Server Express 2019
View install-sqlserverexpress.ps1
function Install-SQLServerExpress2019 {
Write-Host "Downloading SQL Server Express 2019..."
$Path = $env:TEMP
$Installer = "SQL2019-SSEI-Expr.exe"
$URL = "https://go.microsoft.com/fwlink/?linkid=866658"
Invoke-WebRequest $URL -OutFile $Path\$Installer
Write-Host "Installing SQL Server Express..."
Start-Process -FilePath $Path\$Installer -Args "/ACTION=INSTALL /IACCEPTSQLSERVERLICENSETERMS /QUIET" -Verb RunAs -Wait
Remove-Item $Path\$Installer
@hbulens
hbulens / install-azure-ad-app.ps1
Last active May 10, 2021
Create an Azure AD App with application permissions using PowerShell. Courtesy of https://stackoverflow.com/a/61458391/1842261
View install-azure-ad-app.ps1
param (
[Parameter(mandatory = $false, HelpMessage = "The name of the Azure AD App.")]
[string] $appName = "dime-scheduler",
[Parameter(mandatory = $true, HelpMessage = "The id of the Azure tenant ")]
[string] $tenantId,
[Parameter(mandatory = $true, HelpMessage = "The name of the Azure tenant ")]
[string] $tenantName,
View get-ds-logs.ps1
param (
[Parameter(mandatory = $false, HelpMessage = "The name of the Azure AD App.")]
[string] $appName = "dime-scheduler",
[Parameter(mandatory = $true, HelpMessage = "The id of the Azure tenant ")]
[string] $tenantId,
[Parameter(mandatory = $true, HelpMessage = "The name of the Azure tenant ")]
[string] $tenantName,
View 2016-05-29-working-with-files-with-powershell_008.ps1
Get-ChildItem .\ -include bin,obj -Recurse | foreach { remove-item $_.fullname -Force -Recurse }