Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.86k forks source link

[Az.TrafficManager] Can't update an endpoint on locked down systems (like SAWs) #13543

Open TylerLeonhardt opened 4 years ago

TylerLeonhardt commented 4 years ago

Description

Locked down systems (like SAWs) use ConstrainedLanguage Mode to provide a "more secure" environment when working with production environments. Unfortunately, this also limits what PowerShell is able to do quite a bit.

One of the things that it restricts is the ability to set properties on a .NET object. You're just not allowed to do it... that means that the example to update an endpoint just don't work on SAWs.

Steps to reproduce

$endpoint = Get-AzTrafficManagerEndpoint -Name myendpoint -ProfileName myprofile -ResourceGroupName MyRG -Type ExternalEndpoints
$endpoint.Priority = 3

The result is:

Cannot set property. Property setting is only supported on core types in this language mode

image

Environment data

Windows PowerShell 5.1 on a SAW

Module versions

Az.TrafficManager 1.0.4
ghost commented 4 years ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @tmsuppgithub.

Issue Details
## Description Locked down systems (like SAWs) use [ConstrainedLanguage Mode](https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_language_modes?view=powershell-7.1#constrained-language-constrained-language) to provide a "more secure" environment when working with production environments. Unfortunately, this also limits what PowerShell is able to do quite a bit. One of the things that it restricts is the ability to set properties on a .NET object. You're just not allowed to do it... that means that [the example to update an endpoint](https://docs.microsoft.com/en-us/azure/traffic-manager/traffic-manager-powershell-arm#example-2-updating-an-endpoint-using-get-aztrafficmanagerendpoint-and-set-aztrafficmanagerendpoint) just don't work on SAWs. ## Steps to reproduce ```powershell $endpoint = Get-AzTrafficManagerEndpoint -Name myendpoint -ProfileName myprofile -ResourceGroupName MyRG -Type ExternalEndpoints $endpoint.Priority = 3 ``` The result is: > Cannot set property. Property setting is only supported on core types in this language mode ![image](https://user-images.githubusercontent.com/2644648/99585362-142b8c00-299b-11eb-8ac2-a964b2ae06c1.png) ## Environment data ``` Windows PowerShell 5.1 on a SAW ``` ## Module versions ```powershell Az.TrafficManager 1.0.4 ```
Author: TylerLeonhardt
Assignees: -
Labels: `Network - Traffic Manager`, `Service Attention`
Milestone: -