Comments (5)
I can see a public command for this. You mention a resource but it looks like you mean a command? Maybe you aiming for both?
Would be great if we can avoid using Load()
or LoadWithPartialName()
since it will just return the first version if finds in the GAC, which can be the wrong version if multiple SQL Server major versions are installed.
It would be better if the type was available by just running Import-Module
.
Import-Module -Name 'SqlServer' # or 'dbatools' might work?
$smoServer = Connect-SqlDscDatabaseEngine -ServerName 'testclu01a' -InstanceName 'SQL2014'
# If the correct assembly is missing in the module SqlServer (or dbatools) this call fails.
$integrationServices = New-Object -TypeName 'Microsoft.SqlServer.Management.IntegrationServices.IntegrationServices' -ArgumentList @($smoServer)
from sqlserverdsc.
If using Import-Module
as mentioned in previous comment fails then as an alternative we should aim to use Load()
to make sure the correct version of the assembly is loaded. See example:
Import-Assembly
is an internal function
from sqlserverdsc.
Ideally it would be a resource. So could do something like the following in DSC to create an Integration Services Catalog.
SqlIntegrationServicesCatalog 'SSISDB' {
ServerName = 'localhost'
InstanceName = 'MSSQLSERVER'
CatalogPassword = $secret
Ensure = 'Present'
}
from sqlserverdsc.
For now I am utilizing the Microsoft documented commands in a Script Task. Though oddly fails for SQL 2022, but works for all other versions of SQL which I have tested (2019, 2016).
With SQL 2022 only, it produces this error and only when run in DSC. If executed manually on the server it works.
from sqlserverdsc.
Would be great if this would be a public commands (Get-, Test-, New-), then the public commands can be used in a class-based resource.
The error you seeing can be the result of conflicting assemblies. That looks like a typical error for those scenarios when using the Load() methods. Important that all resources use the correct version of the same assemblies. But I'm just guessing, it could be another problem.
from sqlserverdsc.
Related Issues (20)
- [SqlAGListeners]SqlAGListeners] The character length of the 16 argument is too long HOT 4
- SqlDatabaseObjectPermission: INSERT permission never shows as InDesiredState when other permissions are on the table HOT 4
- SqlRs: Integration test fails on SQL Server 2022 HOT 3
- Install-SqlDscReportingServices: New command proposal
- Get-SqlDscReportingServices: New command proposal
- Uninstall-SqlDscReportingServices: New command proposal
- Get-SqlDscReportingsServicesConfiguration: New command proposal
- Initialize-SqlDscReportServer: New command proposal
- Set-SqlDscReportServerVirtualDirectory: New command proposal
- Add-SqlDscReportServerUrlReservation: New command proposal
- Request-SqlDscReportServerDatabaseScript: New command proposal
- Register-SqlDscReportServerDatabaseScript: New command proposal HOT 1
- Request-SqlDscReportServerDatabaseRightsScript: New command proposal
- Register-SqlDscReportServerDatabaseRightsScript: New command proposal HOT 1
- Set-SqlDscReportServerDatabaseConnection: New command proposal
- Enable-SqlDscReportServerTls: New command proposal HOT 1
- Disable-SqlDscReportServerTls: New command proposal
- Remove-SqlDscReportServerUrlReservation: New command proposal
- Restore-SqlDscDatabase: New command proposal HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqlserverdsc.