Hi,

Can you tell me if Powershell 7 should be supported or not?

I tried running the Invoke-DatabaseBuild cmdlet and I get this error in PS 7, but not in PS 5:

Invoke-DatabaseBuild: An unhandled error occurred: System.TypeInitializationException: The type initializer for 'Microsoft.Data.SqlClient.SqlConnection' threw an exception.
 ---> System.MissingMethodException: Method not found: 'System.Security.CodeAccessPermission System.Data.Common.DbProviderFactory.CreatePermission(System.Security.Permissions.PermissionState)'.
   at Microsoft.Data.SqlClient.SqlConnection.CreateExecutePermission()
   at Microsoft.Data.SqlClient.SqlConnection..cctor()
   --- End of inner exception stack trace ---
   at Microsoft.Data.SqlClient.SqlConnection..ctor()
   at Microsoft.Data.SqlClient.SqlConnection..ctor(String connectionString, SqlCredential credential)
   at Microsoft.Data.SqlClient.SqlConnection..ctor(String connectionString)
   at RedGate.Versioning.Automation.Shared.SQL.DatabaseExistenceChecker.CheckDatabaseExists(String connectionString) in D:\BuildAgentC\work\3367df887a9829e1\Clients\PowerShell\Cmdlets\RedGate.Versioning.Automation.Shared\SQL\DatabaseExistenceChecker.cs:line 18
   at RedGate.Versioning.Automation.Compare.SchemaValidation.ScratchDatabase.Dispose() in D:\BuildAgentC\work\3367df887a9829e1\Clients\PowerShell\Cmdlets\RedGate.Versioning.Automation.Compare\SchemaValidation\ScratchDatabase.cs:line 44
   at RedGate.Versioning.Automation.Compare.SchemaValidation.ProjectValidator.ValidateProject(String projectPath, CreateDatabaseParameters createDatabaseParameters) in D:\BuildAgentC\work\3367df887a9829e1\Clients\PowerShell\Cmdlets\RedGate.Versioning.Automation.Compare\SchemaValidation\ProjectValidator.cs:line 26
   at RedGate.Versioning.Automation.PowerShell.Commands.InvokeDatabaseBuildCommandImpl.Process() in D:\BuildAgentC\work\3367df887a9829e1\Clients\PowerShell\Cmdlets\RedGate.Versioning.Automation.PowerShell\Commands\InvokeDatabaseBuildCommand.cs:line 265
   at RedGate.Versioning.Automation.PowerShell.DlmAutomationCommandImpl`1.ProcessRecord() in D:\BuildAgentC\work\3367df887a9829e1\Clients\PowerShell\Cmdlets\RedGate.Versioning.Automation.PowerShell\DlmAutomationCommandImpl.cs:line 177 
   at RedGate.PowerShell.CommandBase`2.DelegateTo(Action doImplementation)

EricLamontagne
0

Comments

7 comments

  • Ivo_Miller
    PowerShell 7 is not yet supported unfortunately. Some work has been done towards it and we will likely do some more investigations into supporting it in the near future. It is definitely on our radar. We are currently limited to PowerShell 5.
    Ivo_Miller
    0
  • PeterDanielsCRB
    I discovered this as well.  @Ivo_Miller - Docs at https://documentation.red-gate.com/sca/getting-started/system-requirements/powershell-component-requirements
    still just say:

    Supported PowerShell versions

    • PowerShell 3 or above
    Would be helpful to get the docs updated with a disclaimer re: pwsh 7.
    PeterDanielsCRB
    0
  • PeterDanielsCRB
    Any updates on this?  I'd love to not switch back and forth between powershell 5.x and 7.x.
    PeterDanielsCRB
    0
  • Ivo_Miller
    Hi,

    It is still very much on our radar and some further progress has been made towards it.
    Updating to PowerShell 7 requires moving all our code to support net core. Much of that is done but it requires work from multiple teams as our PowerShell components support a number of different integrations.
    Ivo_Miller
    0
  • PeterDanielsCRB
    Thanks for the update, @Ivo_Miller.  Much appreciated.  I know this is a large undertaking.  I also imagine that actually getting the SCA tooling to fully port to linux and mac is an even larger project.  Glad to hear you are making some headway in this direction.
    PeterDanielsCRB
    0
  • thecro
    hello. can you please make the support for powershell 7 work now. it's been two years since you told us you're working on it. I just wanted to make a parallel loop - and I can't because you don't support powershell 7 :(
    thecro
    0
  • EricLamontagne
    I don't know if redgate is still developing SCA. As far as I can tell, they are pushing flyway to replace it.
    EricLamontagne
    0

Add comment

Please sign in to leave a comment.