aws / aws-tools-for-powershell

The AWS Tools for PowerShell lets developers and administrators manage their AWS services from the PowerShell scripting environment.
Apache License 2.0
235 stars 77 forks source link

New-GLUEJob Cannot bind parameter 'Command'. Cannot create object of type "Amazon.Glue.Model.JobCommand" #257

Closed dburtsev closed 2 years ago

dburtsev commented 2 years ago

Describe the bug

variable [Amazon.Glue.Model.JobCommand]$jobCom works with Update-GLUEJob but doesn't work with New-GLUEJob.

Expected Behavior

Create new job

Current Behavior

$Output = New-GLUEJob $JobParams | ~~ | Cannot bind parameter 'Command'. Cannot create object of type "Amazon.Glue.Model.JobCommand". The SecurityConfiguration property was not found for the Amazon.Glue.Model.JobCommand object. The available property is: | [Name ] , [PythonVersion ] , [ScriptLocation ]

Reproduction Steps

#PowerShell 7.2
[Amazon.Glue.Model.JobCommand]$jobCom = New-Object -TypeName Amazon.Glue.Model.JobCommand
# read from file into [string]$json variable
$jobCom = ConvertFrom-Json -InputObject $json
            $JobParams = @{
                "Command" = $jobCom 
                "Connections_Connection" = $conList 
                "DefaultArgument" = [System.Collections.Hashtable]$defArg 
                "Description" = $Description 
                "GlueVersion" = $GlueVersion 
                "ExecutionProperty_MaxConcurrentRun" = $MaxConcurrentRun 
                "MaxRetry" = $MaxRetry 
                "Name" = $dir.RelativePath 
                "NonOverridableArgument" = $NonOverridableArgument 
                "NotificationProperty_NotifyDelayAfter" = $nProp.NotifyDelayAfter 
                "NumberOfWorker" = $NumberOfWorker 
                "Role" = $Role 
                "SecurityConfiguration" = $SecurityConfiguration 
                "Timeout" = $Timeout 
                "WorkerType" = $wt
            }
            $Output = New-GLUEJob $JobParams

Possible Solution

No response

Additional Information/Context

No response

AWS Tools for PowerShell version used

latest

PowerShell version used


PSVersion 7.2.2 PSEdition Core GitCommitId 7.2.2 OS Microsoft Windows 10.0.19042 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0

Operating System and version

Windows 10

dburtsev commented 2 years ago

Don't use $JobParams = @{...

github-actions[bot] commented 2 years ago

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.