Skip to content

Set-PagerDutMaintenanceWindow is not working #4

@hales8181

Description

@hales8181

When running the below:
Import-module O:\Powershell\modules\PagerDuty\PagerDuty.psd1
$StartTime = $((Get-Date).ToString("s"))
$EndTime = $((Get-Date).Addminutes(15).ToString("s"))
Set-PagerDutyMaintenanceWindow -id PJ1RHHL -StartTime $StartTime -EndTime $EndTime

I am getting the below error:

Exception calling "ApiPut" with "2" argument(s): "Exception calling "ApiCallBase" with "3" argument(s): "The remote server returned an error: (400) Bad Request.""
At O:\Powershell\modules\PagerDuty\MaintenanceWindows\MaintenanceWindows.ps1:157 char:9

  •     $Result = $PagerDutyCore.ApiPut($Uri, $Body)
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    • FullyQualifiedErrorId : ScriptMethodRuntimeException

You cannot call a method on a null-valued expression.
At O:\Powershell\modules\PagerDuty\MaintenanceWindows\MaintenanceWindows.ps1:158 char:9

  •     $Result.maintenance_window.pstypenames.Insert(0,'PagerDuty.Ma ...
    
  •     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (:) [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions