Skip to content

Instantly share code, notes, and snippets.

View dwaldmannDE's full-sized avatar

Daniel Waldmann dwaldmannDE

View GitHub Profile
$packagePath = "C:\temp\update.msu"
function PatchPackage([string]$mountDir, [string]$packagePath) {
# Add package
Write-Output("Apply package:" + $packagePath)
Dism /Add-Package /Image:$mountDir /PackagePath:$packagePath
if ($LASTEXITCODE -eq 0) {
Write-Output("Successfully applied the package")
}
else {
Write-Output("Applying the package failed with exit code: " + $LASTEXITCODE)
@dwaldmannDE
dwaldmannDE / sepa.xml
Created April 6, 2019 09:20
SEPA XML Sammellastschrift
<?xml version="1.0" encoding="UTF-8"?>
<Document xsi:schemaLocation="urn:iso:std:iso:20022:tech:xsd:pain.008.002.02 pain.008.002.02.xsd"
xmlns="urn:iso:std:iso:20022:tech:xsd:pain.008.002.02"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CstmrDrctDbtInitn>
<GrpHdr>
<MsgId>Sammler2018</MsgId>
<CreDtTm>2018-09-10T09:25:48.000000+01:00</CreDtTm>
<NbOfTxs>2</NbOfTxs>
<CtrlSum>3.00</CtrlSum>
#CopyFromSD
$PathToExternalMedia = "D:\" #Pfad bzw. Laufwerksbuchstabe der SD-Karte
$PathToDestination = "C:\Users\Daniel\Pictures" #Pfad an den der Inhalt der SD-Karte kopiert wird
$FileList = Get-ChildItem -Path $PathToExternalMedia -Recurse -File
$i = 0
$FileCount = $FileList.Count
@dwaldmannDE
dwaldmannDE / Get-PodioAPI.ps1
Last active December 10, 2017 13:14
Using the Podio API with PowerShell (Authentification, Getting Items from an app). We are pretending that the podio app, that we want to access, stores a list of people and we want to retrieve the first- and last names
function Get-PodioAPIAuthorization() {
$PostParams = @{grant_type = "app"; app_id = ""; app_token = ""; client_id = ""; redirect_uri = ""; client_secret = ""}
#Params for the Authentification have to be hardcoded
$Result = Invoke-RestMethod -Uri https://podio.com/oauth/token -Method POST -Body $postParams
return $Result.access_token
}