Powershell 7

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)

Tagged:

Best Answer

  • Ivo_MillerIvo_Miller Posts: 31 Silver 3
    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
    RedGate Software Developer

Answers

Sign In or Register to comment.