- E.g. double your screen resolution like here:
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
# this method allows a command execution with a hashtable instead of one big line | |
$restParams = @{ | |
method = "Get" | |
uri = "https://www.google.de" | |
ContentType = "application/json" | |
verbose = $true | |
} | |
Invoke-RestMethod @restParams # note the @ instead of the $ |
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
SELECT * | |
,BIGINT (DATE) AS DATEERN -- this is used as ERN field | |
,CASE Kundennummer WHEN '0' THEN '9999'||lpad(dayofyear(date),4,'0') ELSE Kartennummer END CONCAT '|' CONCAT BIGINT (DATE) AS DateKey | |
FROM APTECO.BONS | |
WHERE DATE BETWEEN ( | |
TIMESTAMP_FORMAT(CASE | |
WHEN @ERN < BIGINT (0) | |
THEN '20161231' | |
ELSE @ERN |
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
<# | |
.SYNOPSIS | |
Conversion of valid xml into a PSCustomObject, so it can be easily used to create json instead | |
.DESCRIPTION | |
Inspired from the C# example from: Translated into PowerShell from https://dev.to/adamkdean/xml-to-hashtable-59dg | |
This script uses xml input and converts all tags and attributes into a PSCustomObject. | |
This allows a much easier transformation into a json object. | |
.EXAMPLE | |
# Using this input xml (could also be a file) ... |
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
# Things you might want to change | |
# options(papersize="a4") | |
# options(editor="notepad") | |
# options(pager="internal") | |
# set the default help type | |
# options(help_type="text") | |
options(help_type="html") |
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
<# | |
Good example inspired from here | |
https://gist.github.com/SteveGilham/98a39f621cfed70bfa0a | |
To explore possible events, type in | |
$timer | gm | |
#> |
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
<# | |
HINTS | |
# check bitwise: https://ingogegenwarth.wordpress.com/2016/11/17/powershell-and-bit-field-attributes/ | |
#> | |
# Good example because the cleverreach api checks the details to download bitwise... those are the values | |
$cleverreachDetails = @{ | |
events = 1 |
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
# current unixtimestamp with the optional milliseconds | |
Function Get-Unixtime { | |
param( | |
[Parameter(Mandatory=$false)][switch] $inMilliseconds = $false | |
,[Parameter(Mandatory=$false)][DateTime] $timestamp = ( Get-Date ) | |
) | |
$multiplier = 1 |
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
$logfile = "D:\Apteco\Log\backup_manual.log" | |
# log | |
"$( [datetime]::Now.ToString("yyyyMMddHHmmss") )`t-------------------------------" >> $logfile | |
# Get all local drives that are currently used (used space greater than 0) and format the numbers and output as list | |
$currentSpace = Get-PSDrive -PSProvider FileSystem | where { $_.Used -gt 0 } | Select Root, @{name="Used (GB)";expression={ ($_.Used/1GB).ToString(".00") }}, @{name="Free (GB)";expression={ ($_.Free/1GB).ToString(".00") }} | fl | |
# check how many backups are in a folder | |
$backupFolder = "D:\Apteco\Publish\<sysname>\backup\" |
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
[int]$month = Read-Host -Prompt "Monat" # In Nummern wie 6 | |
[int]$year = Read-Host -Prompt "Jahr" # In Nummer wie 2020 | |
$firstDay = Get-Date -Day 01 -Month $month -Year $year | |
$firstDayNextMonth = $firstDay.AddMonths(1) | |
$currentDay = $firstDay | |
cls |