- Open Minecraft normally
- Go into a single player game
- When in the gameplay, open the menu and open the game in the LAN
- Note the port and maybe the IP
- Open the minecraft launcher so the current login tokens are getting refreshed
function getRandomString([int] $length) { | |
$random = [Random]::new() | |
$chars = @("0", "2", "3", "4", "5", "6", "8", "9", "a", "b", "c", "d", "e", "f", "g", "h", "j", "k", "m", "n", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z") | |
$stringBuilder = "" | |
for ($i = 0; $i -lt $length; $i++) { | |
$stringBuilder += $chars[$random.Next($chars.Length)] | |
} | |
return $stringBuilder | |
} |
<# | |
Is-Numeric 10 # True | |
Is-Numeric "10" # True | |
Is-Numeric "10f" # False | |
Is-Numeric "+10" # True | |
Is-Numeric "-10" # True | |
Is-Numeric "-10.5" # False | |
#> | |
function Is-Int ($value) { |
# 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 $ |
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 |
<# | |
.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) ... |
# 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") |
<# | |
Good example inspired from here | |
https://gist.github.com/SteveGilham/98a39f621cfed70bfa0a | |
To explore possible events, type in | |
$timer | gm | |
#> |
<# | |
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 |