Skip to content

Instantly share code, notes, and snippets.

View gitfvb's full-sized avatar
👋

Florian von Bracht gitfvb

👋
View GitHub Profile
@gitfvb
gitfvb / readme.md
Created April 15, 2019 15:54
Simple message for using syniverse to send a single SMS via Powershell
  1. Create an account at https://developer.syniverse.com
  2. Whitelist that number, create a company, create an app and generate tokens etc...
  3. Replace in the powershell code
  4. Replace the mobile numbers and the others texts, if wished
@gitfvb
gitfvb / copy_and_change_virtual_variable.ps1
Last active April 2, 2019 10:46
Load, change and save a virtual variable automatically. This way can save you time if you need x similar variables.
################################################
#
# SETTINGS
#
################################################
$virtualVariableReference = "kuBPCHF9"
$virtualBaseDir = "C:\FastStats\Publish\Handel\virtual"
@gitfvb
gitfvb / restart_webapppool.ps1
Created March 27, 2019 14:12
Restart Microsoft Windows IIS AppPool via powershell
# from: https://stackoverflow.com/questions/38311797/recycle-application-pool-using-powershell-script
Import-Module WebAdministration
<#
show all sites
( Get-Item "IIS:\Sites" ).children
show all application pools
@gitfvb
gitfvb / code_generator.ps1
Created March 21, 2019 10:08
10k random string, hash and save as file
# function from https://gallery.technet.microsoft.com/scriptcenter/Get-StringHash-aa843f71
Function Get-StringHash([String] $String,$HashName = "MD5")
{
$StringBuilder = New-Object System.Text.StringBuilder
[System.Security.Cryptography.HashAlgorithm]::Create($HashName).ComputeHash([System.Text.Encoding]::UTF8.GetBytes($String))|%{
[Void]$StringBuilder.Append($_.ToString("x2"))
}
$StringBuilder.ToString()
}
@gitfvb
gitfvb / .gitignore
Last active January 22, 2020 08:33
use profitbricks/IONOS API through powershell
# settings files
ionos.json
# encryption files
aes.key
@gitfvb
gitfvb / search_for_tags_in_filenames.ps1
Last active February 11, 2019 11:56
file organisation with tagging
<#
If you create brackets to your filenames and add some content in there, you can "tag" the files and search for them easily
via file explorer or powershell like written below.
So a filename could look like
testfile_[abd,xyz].pdf
#>
@gitfvb
gitfvb / devices.ps1
Created February 3, 2019 22:40
access devices via powershell
# list all devices like samsung
Get-PnpDevice | where { $_."FriendlyName" -like "*samsung*" }
@gitfvb
gitfvb / bing_batch_geocode.ps1
Last active January 16, 2019 05:26
bing batch geocode - do not forget to replace <yourbingmapskey>
################################################
#
# SETTINGS
#
################################################
# settings for the API
$bingMapskey = "<yourbingmapskey>"
# file should be in UTF8
@gitfvb
gitfvb / joblist_bing.ps1
Created January 11, 2019 09:46
A list of all bing maps geocoding jobs in Powershell, do not forget to replace "<yourbingmapskey>"
$jobs = Invoke-RestMethod -Uri "http://spatial.virtualearth.net/REST/v1/dataflows/listjobs?key=<yourbingmapskey>&output=json" -Method Get # -ProxyUseDefaultCredentials $true # -Proxy "http://proxy:8080" -ProxyCredential $cred
$jobs.resourceSets.resources | select id -expand links
@gitfvb
gitfvb / hash.ps1
Created January 10, 2019 09:51
Hashing of a string in Powershell
Function Get-StringHash()
{
param(
[Parameter(Mandatory=$true)][string]$inputString,
[Parameter(Mandatory=$true)][string]$hashName,
[Parameter(Mandatory=$false)][string]$salt,
[Parameter(Mandatory=$false)][boolean]$uppercase=$false
)
$string = $inputString + $salt