From 670fbdbba8397abb08a6986ecead9fa149dae904 Mon Sep 17 00:00:00 2001 From: Wes Carroll Date: Fri, 19 Jul 2019 11:54:11 -0400 Subject: [PATCH] Change ThrowError to Throw --- ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 index de6869b..0304c88 100644 --- a/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 +++ b/ZertoApiWrapper/Private/Invoke-ZARestRequest.ps1 @@ -15,9 +15,9 @@ function Invoke-ZARestRequest { # Check to see if the required variables are present and currently valid if ( -not ((Test-Path variable:script:zaLastActionTime) -and (Test-Path variable:script:zaHeaders)) ) { - ThrowError -ExceptionName "NoAuth" -ExceptionMessage "Zerto Analytics Connection does not Exist. Please run Connect-ZertoAnalytics first to establish a connection" -errorId "Auth02" -errorCategory "ZertoAuth" -ErrorAction Stop + Throw "Zerto Analytics Connection does not Exist. Please run Connect-ZertoAnalytics first to establish a connection" } elseif ( (Test-Path variable:script:zaHeaders) -and $([datetime]$script:zaLastActionTime).addMinutes(60) -lt $(get-date) ) { - ThrowError -ExceptionName "ExpiredToken" -ExceptionMessage "Authorization Token has Expired. Please re-authorize to the Zerto Analytics Portal" -errorId "Auth01" -errorCategory "ZertoAuth" -ErrorAction Stop + Throw "Authorization Token has Expired. Please re-authorize to the Zerto Analytics Portal" } else { # Update the last action time and submit the request based on PS Version. Set-Variable -Name zaLastActionTime -Scope Script -Value $(Get-date).Ticks