You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#### PowerShell version:
Name Value
---- -----
PSVersion 5.1.17134.765
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17134.765
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
#### dbatools Module version:
Name : dbatools
Path : C:\Program Files\WindowsPowerShell\Modules\dbatools\1.0.4\dbatools.psd1
Version : 1.0.4
# Replace with output of Get-Culture
SQL Server:
Microsoft SQL Server 2016 (SP2-CU5) (KB4475776) -13.0.5264.1 (X64)
Jan 10201918:51:38
Copyright (c) Microsoft Corporation
Enterprise Edition: Core-based Licensing (64-bit) on Windows Server 2016 Standard 10.0<X64> (Build 14393: ) (Hypervisor)
/* REPLACE WITH output of @@LANGUAGE */
Report
Host used
powershell.exe
ISE
VS Code
Other (please specify)
If anything other than powershell.exe was used, please confirm that you can duplicate the issue with powershell.exe
The job step to not be created but no error information displayed.
Actual Behavior
format-default : To accomplish this action, set property CommandExecutionSuccessCode.
+ CategoryInfo : NotSpecified: (:) [format-default], PropertyNotSetException
+ FullyQualifiedErrorId : Microsoft.SqlServer.Management.Smo.PropertyNotSetException,Microsoft.PowerShell.Commands
.FormatDefaultCommand
I was able to duplicate this behavior by manually creating a job step using SMO and trying to output it before it was created. It appears there are several fields it expect to always be set when outputting a job step but they can be defaulted when creating so aren't required. Piping to Select-Object and just selecting properties that had been set did work.
The text was updated successfully, but these errors were encountered:
Environmental information
# Replace with output of Get-Culture
SQL Server:
/* REPLACE WITH output of @@LANGUAGE */
Report
Host used
If anything other than powershell.exe was used, please confirm that you can duplicate the issue with powershell.exe
Errors Received
Steps to Reproduce
New-DbaAgentJob -SqlInstance shareddbtest2\sql2016 -Job 'Test Job'
New-DbaAgentJobStep -SqlInstance shareddbtest2\sql2012 -Job 'Test Job' -StepId 1 -StepName 'Test Step' -Subsyste
m TransactSql -Command 'SELECT 1' -Database 'master' -WhatIf
Expected Behavior
The job step to not be created but no error information displayed.
Actual Behavior
format-default : To accomplish this action, set property CommandExecutionSuccessCode.
+ CategoryInfo : NotSpecified: (:) [format-default], PropertyNotSetException
+ FullyQualifiedErrorId : Microsoft.SqlServer.Management.Smo.PropertyNotSetException,Microsoft.PowerShell.Commands
.FormatDefaultCommand
I was able to duplicate this behavior by manually creating a job step using SMO and trying to output it before it was created. It appears there are several fields it expect to always be set when outputting a job step but they can be defaulted when creating so aren't required. Piping to Select-Object and just selecting properties that had been set did work.
The text was updated successfully, but these errors were encountered: