custom/Set-JcSdkPolicy.ps1
<# .Synopsis This endpoint allows you to update a policy. Given the amount of configurable parameters required to update a Policy, we suggest you use the JumpCloud Admin Console to create new policies.\n\n\n##### Sample Request\n```\ncurl -X PUT https://console.jumpcloud.com/api/v2/policies/59fced45c9118022172547ff \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key: {API_KEY' \\\n -d '{\n {Policy_Parameters}\n}'\n``` .Description This endpoint allows you to update a policy. Given the amount of configurable parameters required to update a Policy, we suggest you use the JumpCloud Admin Console to create new policies.\n\n\n##### Sample Request\n```\ncurl -X PUT https://console.jumpcloud.com/api/v2/policies/59fced45c9118022172547ff \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key: {API_KEY' \\\n -d '{\n {Policy_Parameters}\n}'\n``` .Example PS C:\> {{ Add code here }} {{ Add output here }} .Example PS C:\> {{ Add code here }} {{ Add output here }} .Inputs JumpCloud.SDK.V2.Models.IJumpCloudApIsIdentity .Inputs JumpCloud.SDK.V2.Models.IPolicyRequest .Outputs JumpCloud.SDK.V2.Models.IPolicy .Notes COMPLEX PARAMETER PROPERTIES To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. BODY <IPolicyRequest>: Name <String>: The description for this specific Policy. [TemplateId <String>]: ObjectId uniquely identifying a Policy instance; only allowed on POST requests. [Values <IPolicyValue[]>]: [ConfigFieldId <String>]: The ObjectId of the corresponding Policy Template configuration field. [Value <String>]: The value for the configuration field for this Policy instance. INPUTOBJECT <IJumpCloudApIsIdentity>: [AccountId <String>]: [ActivedirectoryId <String>]: [AppleMdmId <String>]: [ApplicationId <String>]: ObjectID of the Application. [CommandId <String>]: ObjectID of the Command. [DeviceId <String>]: [GroupId <String>]: ObjectID of the System Group. [GsuiteId <String>]: ObjectID of the G Suite instance. [Id <String>]: ObjectID of the System Group. [JobId <String>]: [LdapserverId <String>]: ObjectID of the LDAP Server. [Office365Id <String>]: ObjectID of the Office 365 instance. [PolicyId <String>]: ObjectID of the Policy. [ProviderId <String>]: [RadiusserverId <String>]: ObjectID of the Radius Server. [SystemId <String>]: ObjectID of the System. [UserId <String>]: ObjectID of the User. [WorkdayId <String>]: VALUES <IPolicyValue[]>: [ConfigFieldId <String>]: The ObjectId of the corresponding Policy Template configuration field. [Value <String>]: The value for the configuration field for this Policy instance. .Link https://github.com/TheJumpCloud/jcapi-powershell/tree/master/SDKs/PowerShell/jumpcloud.sdk.v2/set-jcsdkpolicy #> Function Set-JcSdkPolicy { [OutputType([JumpCloud.SDK.V2.Models.IPolicy])] [CmdletBinding(DefaultParameterSetName='PutExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] Param( [Parameter(ParameterSetName='Put', Mandatory)] [Parameter(ParameterSetName='PutExpanded', Mandatory)] [JumpCloud.SDK.V2.Category('Path')] [System.String] # ObjectID of the Policy object. ${Id}, [Parameter(ParameterSetName='PutViaIdentity', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='PutViaIdentityExpanded', Mandatory, ValueFromPipeline)] [JumpCloud.SDK.V2.Category('Path')] [JumpCloud.SDK.V2.Models.IJumpCloudApIsIdentity] # Identity Parameter # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. ${InputObject}, [Parameter(ParameterSetName='Put', Mandatory, ValueFromPipeline)] [Parameter(ParameterSetName='PutViaIdentity', Mandatory, ValueFromPipeline)] [JumpCloud.SDK.V2.Category('Body')] [JumpCloud.SDK.V2.Models.IPolicyRequest] # An instance of a policy template. # To construct, see NOTES section for BODY properties and create a hash table. ${Body}, [Parameter(ParameterSetName='PutExpanded', Mandatory)] [Parameter(ParameterSetName='PutViaIdentityExpanded', Mandatory)] [JumpCloud.SDK.V2.Category('Body')] [System.String] # The description for this specific Policy. ${Name}, [Parameter(ParameterSetName='PutExpanded')] [Parameter(ParameterSetName='PutViaIdentityExpanded')] [JumpCloud.SDK.V2.Category('Body')] [System.String] # ObjectId uniquely identifying a Policy instance; only allowed on POST requests. ${TemplateId}, [Parameter(ParameterSetName='PutExpanded')] [Parameter(ParameterSetName='PutViaIdentityExpanded')] [JumpCloud.SDK.V2.Category('Body')] [JumpCloud.SDK.V2.Models.IPolicyValue[]] # . # To construct, see NOTES section for VALUES properties and create a hash table. ${Values} ) Begin { $Results = @() } Process { $Results = JumpCloud.SDK.V2.internal\Set-JcSdkInternalPolicy @PSBoundParameters } End { Return $Results } } |