PnP PowerShell errors occurring in Azure Automation #127
Unanswered
ShuheiIwama
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
When I process the following PnP PowerShell with Azure Automation, sometimes an error occurs.
There are two types of errors, and we don't know under what conditions they are differentiated.
It seems to happen when I run Azure Automation at the same time, does anyone know the cause of this?
Environment
Script
line
108 $Web = Get-PnPWeb -Includes RegionalSettings.TimeZones
109 $NewTimeZone = $Web.RegionalSettings.TimeZones | Where {$_.Description -eq $TimeZone}
110 [int]$NewTimeZoneId = $NewTimeZone.Id
*$TimeZone contains values such as "(UTC-12:00) International Date Line West" and "(UTC-05:00) Eastern Time (US and Canada)".
Error Description Pattern 1
Get-PnPWeb : The 'subQuery' argument is invalid. At line:108 char:8 + $Web = Get-PnPWeb -Includes RegionalSettings.TimeZones + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : WriteError: (:) [Get-PnPWeb], ArgumentException + FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.GetWeb
Error Description Pattern 2
Cannot convert the "System.Object[]" value of type "System.Object[]" to type "System.Int32". At line:110 char:1 + [int]$NewTimeZoneId = $NewTimeZone.Id + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : MetadataError: (:) [], ArgumentTransformationMetadataException + FullyQualifiedErrorId : RuntimeException
I'm looking forward to working with you.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions