This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# change this for the emarsys request | |
$username = "username001" | |
$secret = "secret" | |
$url = "https://trunk-int.s.emarsys.com/api/v2/field/translate/de" | |
#$url = "https://trunk-int.s.emarsys.com/api/v2/settings" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add-Type -AssemblyName System.Windows.Forms | |
Function Get-FileName($initialDirectory, $filter) | |
{ | |
$OpenFileDialog = New-Object System.Windows.Forms.OpenFileDialog | |
$OpenFileDialog.initialDirectory = $initialDirectory | |
$OpenFileDialog.filter = $filter | |
$OpenFileDialog.ShowDialog() | Out-Null | |
$OpenFileDialog.filename |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################ | |
# | |
# SCRIPT ROOT | |
# | |
################################################ | |
# script root path | |
if ($MyInvocation.MyCommand.CommandType -eq "ExternalScript") | |
{ $scriptPath = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Older style, with better compatibility | |
$timestampTwo = Get-Date -Format "yyyyMMddHHmmss" | |
$timestampTwoUTC = (Get-Date).ToUniversalTime().ToString("yyyyMMddHHmmss") | |
# Newer style, but not always compatible | |
$timestampOne = [datetime]::Now.ToString("yyyyMMddHHmmss") | |
$timestampOneUTC = [datetime]::UtcNow.ToString("yyyyMMddHHmmss") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[uri]::EscapeDataString("bla bla") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
download nuget cli tool | |
https://www.nuget.org/downloads | |
#> | |
# add orbit source repository for nuget | |
.\nuget.exe sources add -name "Apteco Orbit" -Source "https://orbit.apteco.com/FastStatsOrbitUpdateServer/nuget" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rewriteFile() { | |
param( | |
[Parameter(Mandatory=$true)][string]$inputPath, | |
[Parameter(Mandatory=$true)][int]$inputEncoding, | |
[Parameter(Mandatory=$true)][string]$outputPath, | |
[Parameter(Mandatory=$true)][int]$outputEncoding, | |
[Parameter(Mandatory=$false)][int]$skipFirstLines |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CustId Straße PLZ Ort | |
123 D-Str. 5 52080 Aachen | |
456 Am Keller 2 61080 Bad Vilbel | |
789 Kaiserstraße 35 60329 Frankfurt am Main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# check some rows in between | |
cd "<path>" | |
$file = Get-Item -path "filename.csv" | |
$readFirstLine = $true | |
$startLine = 121200 | |
$endLine = 121400 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################ | |
# | |
# PREPARATION / ASSEMBLIES | |
# | |
################################################ | |
# Load scriptpath | |
if ($MyInvocation.MyCommand.CommandType -eq "ExternalScript") { | |
$scriptPath = Split-Path -Parent -Path $MyInvocation.MyCommand.Definition | |
} else { |