Statusimo icon indicating copy to clipboard operation
Statusimo copied to clipboard

New-StatusimoEvent Not Creating Incident JSON inside of Specified Folder

Open MrCarter2959 opened this issue 3 years ago • 0 comments

I'm following the examples provided in the \Examples\Add-Incident2.ps1 file, and I cannot replicate/get my JSON file to create in the folder I've specified.

I tried New-StatusimoMaintenance and it created the file just fine and added into the statusimo status page. I've included both of my Splat's and Examples that I'm using below. Both Incident and Maintenance Examples provided are taken straight from the \Examples folder and modified to fit my test environment. All Variables point to the same folder, and Incidents/Maintenance are sub folders. Variables are populated with data. Just installed Statusimo today from the PSGallery

Get-Module Statusimo

ModuleType Version    Name                                ExportedCommands                                                                                                                                                                                  
---------- -------    ----                                ----------------                                                                                                                                                                                  
Script     0.6        Statusimo                           {New-StatusimoEvent, New-StatusimoMaintenance, New-StatusimoPage, Remove-StatusimoMaintenance...}    
$dashboard = "Path\To\page.html"
$incidents = "Path\To\Incidents\"
$maintenance = "Path\To\Maintenance\"

$incidentSplat = @{
    Date       = (Get-Date)
    Overview   = "Test"
    Title      = 'Test'
    Status     = 'Operational'
    Service    = 'Test'
    FolderPath = $incidents
}

New-StatusimoEvent @incidentSplat

$newStatusimoMaintenanceSplat = @{
    Title = 'Test'
    DateStart = (Get-Date).AddDays(5)
    DateEnd = (Get-Date).AddDays(6).AddHours(2)
    Service = 'Test'
    Overview = "Test"
    FolderPath = $maintenance
}
New-StatusimoMaintenance @newStatusimoMaintenanceSplat 
New-StatusimoPage -FilePath $dashboard -IncidentsPath $incidents -MaintenancePath $maintenance

I then go to my folder specified in $incidents and there is nothing there, but if I would check maintenance. There would be a valid JSON with a similar name to Test_CURRENT_DATE_random_string.json.

MrCarter2959 avatar May 18 '22 19:05 MrCarter2959