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
We've been running the Invoke-DacpacDeployment command successfully for our SQL deployment scenarios in PowerShell 5.x for a while. However, when switching over to using the latest PowerShell 7.3.x version it would fail to execute by throwing an error "Illegal characters in path". Upon investigation, we determined that the error was coming from the ExecuteCommand function in the same PowerShell model where the invoke command was defined (SqlPackageOnTargetMachines.ps1). In that method there is an "if" statement that switches execution based upon the version of PowerShell currently being executed. The else section fails for PowerShell 7.3.x because of a breaking issue with how PowerShell parses arguments (see here). After following the bread crumbs and landing upon this StackOverflow article, we found out that setting the $PSNativeCommandArgumentPassing global variable to 'Legacy' seems to resolve the issue. However, we had to make the change directly to the method in the SqlPackageOnTargetMachines.ps1 - the global variable setting doesn't seem to flow down from our external script.
We've been running the
Invoke-DacpacDeployment
command successfully for our SQL deployment scenarios in PowerShell 5.x for a while. However, when switching over to using the latest PowerShell 7.3.x version it would fail to execute by throwing an error "Illegal characters in path". Upon investigation, we determined that the error was coming from theExecuteCommand
function in the same PowerShell model where the invoke command was defined (SqlPackageOnTargetMachines.ps1
). In that method there is an "if" statement that switches execution based upon the version of PowerShell currently being executed. Theelse
section fails for PowerShell 7.3.x because of a breaking issue with how PowerShell parses arguments (see here). After following the bread crumbs and landing upon this StackOverflow article, we found out that setting the$PSNativeCommandArgumentPassing
global variable to 'Legacy' seems to resolve the issue. However, we had to make the change directly to the method in theSqlPackageOnTargetMachines.ps1
- the global variable setting doesn't seem to flow down from our external script.Here is the change we made in brief:
Is this something you think should be modified in this library or do you have any reservations about the change impacting other commands?
The text was updated successfully, but these errors were encountered: