last stats

This commit is contained in:
Lanta 2023-09-25 13:59:18 +02:00
parent 76a4165d8a
commit fc182750ca
5 changed files with 185 additions and 2 deletions

View file

@ -1,3 +1,10 @@
if($PSScriptRoot.length -eq 0){
$scriptroot = Get-Location
}else{
$scriptroot = $PSScriptRoot
}
function get-killstats {
param (
$player_name,
@ -69,3 +76,22 @@ foreach ($player in $all_player_matches.playername) {
}
}
$currentDateTime = Get-Date
# Get current timezone
$currentTimezone = (Get-TimeZone).Id
# Format and parse the information into a string
$formattedString = "$currentDateTime - Time Zone: $currentTimezone"
# Output the formatted string
$playerstats += [PSCustomObject]@{
updated = $formattedString
}
($playerstats | convertto-json) | out-file "$scriptroot/../data/player_last_stats.json"