Skip to content

Instantly share code, notes, and snippets.

View hthoma's full-sized avatar
:bowtie:

Harry hthoma

:bowtie:
View GitHub Profile
function Generate-JWT (
[Parameter(Mandatory = $True)]
[ValidateSet("HS256", "HS384", "HS512")]
$Algorithm = $null,
$type = $null,
[Parameter(Mandatory = $True)]
[string]$Issuer = $null,
[int]$ValidforSeconds = $null,
[Parameter(Mandatory = $True)]
$SecretKey = $null
@hthoma
hthoma / json2dictionaries.cs
Last active August 14, 2018 13:37
Populating dictionaries with serialized json
String filename = DateTime.Today.Day.ToString() + DateTime.Today.Month.ToString() + DateTime.Today.Year.ToString() + Environment.MachineName.ToString() + ".log";
DateTime LastAccessed = File.GetLastWriteTime(@"C:\RestartLogs\" + filename);
Dictionary<string, string> stepDataPropertiesDictonary = null;
Dictionary<string, string> appointmentPropertiesDictionary = null;
Dictionary<string, string> testCenterPropertiesDictionary = null;
if (LastAccessed.AddMinutes(5) > DateTime.Now)
{
String json = File.ReadAllText(@"C:\RestartLogs\" + filename);
JObject parsedJson = JObject.Parse(json);
{"testData":
[
{
"unixTime": 1529673857,
"eventName": "Test Opened",
"pageCount": "1",
"skip": "false"
},
{
"unixTime": 1529673859,