Skip to content

Commit

Permalink
Add Registered Server Support for Core (mac/linux) (#5153)
Browse files Browse the repository at this point in the history
* bulk changes to support CMS / Registered Servers

* moved some commands
  • Loading branch information
potatoqualitee authored Mar 5, 2019
1 parent bd97a27 commit d94ea3f
Show file tree
Hide file tree
Showing 20 changed files with 223 additions and 28 deletions.
Binary file modified bin/smo/coreclr/Microsoft.Data.Tools.Sql.BatchParser.dll
Binary file not shown.
Binary file modified bin/smo/coreclr/Microsoft.SqlServer.ConnectionInfo.dll
Binary file not shown.
Binary file modified bin/smo/coreclr/Microsoft.SqlServer.Management.Dmf.dll
Binary file not shown.
Binary file modified bin/smo/coreclr/Microsoft.SqlServer.Management.PSProvider.dll
Binary file not shown.
Binary file modified bin/smo/coreclr/Microsoft.SqlServer.Management.PSSnapins.dll
Binary file not shown.
Binary file not shown.
Binary file modified bin/smo/coreclr/Microsoft.SqlServer.Management.Sdk.Sfc.dll
Binary file not shown.
Binary file modified bin/smo/coreclr/Microsoft.SqlServer.Management.XEvent.dll
Binary file not shown.
Binary file modified bin/smo/coreclr/Microsoft.SqlServer.Management.XEventDbScoped.dll
Binary file not shown.
Binary file not shown.
Binary file modified bin/smo/coreclr/Microsoft.SqlServer.Management.XEventEnum.dll
Binary file not shown.
Binary file modified bin/smo/coreclr/Microsoft.SqlServer.Smo.dll
Binary file not shown.
Binary file modified bin/smo/coreclr/Microsoft.SqlServer.SmoExtended.dll
Binary file not shown.
Binary file modified bin/smo/coreclr/Microsoft.SqlServer.SqlEnum.dll
Binary file not shown.
Binary file added bin/smo/coreclr/Microsoft.SqlTools.Hosting.dll
Binary file not shown.
Binary file not shown.
Binary file added bin/smo/coreclr/System.Data.SqlClient.dll
Binary file not shown.
213 changes: 202 additions & 11 deletions dbatools.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -445,15 +445,23 @@
'Invoke-DbaDbDbccUpdateUsage',
'Get-DbaDbIdentity',
'Set-DbaDbIdentity',
'Get-DbaCmsRegServerStore',
'Get-DbaCmsRegServer',
'Add-DbaCmsRegServer',
'Add-DbaCmsRegServerGroup',
'Export-DbaCmsRegServer',
'Import-DbaCmsRegServer',
'Move-DbaCmsRegServer',
'Move-DbaCmsRegServerGroup',
'Remove-DbaCmsRegServer',
'Remove-DbaCmsRegServerGroup',
# noncoresmo
# SMO issues
'Export-DbaUser',
'Get-DbaSsisExecutionHistory',
'Get-DbaRepDistributor',
'Get-DbaCmsRegServerStore',
'Copy-DbaPolicyManagement',
'Copy-DbaDataCollector',
'Get-DbaCmsRegServer',
'Copy-DbaSsisCatalog',
'New-DbaSsisCatalog',
'Get-DbaSsisEnvironmentVariable',
Expand All @@ -463,14 +471,6 @@
'Get-DbaPbmObjectSet',
'Get-DbaPbmPolicy',
'Get-DbaPbmStore',
'Add-DbaCmsRegServer',
'Add-DbaCmsRegServerGroup',
'Export-DbaCmsRegServer',
'Import-DbaCmsRegServer',
'Move-DbaCmsRegServer',
'Move-DbaCmsRegServerGroup',
'Remove-DbaCmsRegServer',
'Remove-DbaCmsRegServerGroup',
'Get-DbaRepPublication',
'Test-DbaRepLatency',
'Export-DbaRepServerSetting',
Expand Down Expand Up @@ -625,7 +625,198 @@
# Aliases to export from this module
# Aliases are stored in dbatools.psm1
# KEEP Detach-DbaDatabase, Dismount-DbaDatabase and Start-SqlMigration FOREVER
AliasesToExport = '*'
AliasesToExport = @(
'Add-DbaRegisteredServer',
'Add-DbaRegisteredServerGroup',
'Attach-DbaDatabase',
'Backup-DbaDatabaseCertificate',
'Backup-DbaDatabaseMasterKey',
'Clear-DbaSqlConnectionPool',
'Connect-DbaServer',
'Copy-DbaAgentCategory',
'Copy-DbaAgentProxyAccount',
'Copy-DbaAgentSharedSchedule',
'Copy-DbaCentralManagementServer',
'Copy-DbaDatabaseAssembly',
'Copy-DbaDatabaseMail',
'Copy-DbaExtendedEvent',
'Copy-DbaQueryStoreConfig',
'Copy-DbaSqlDataCollector',
'Copy-DbaSqlPolicyManagement',
'Copy-DbaSqlServerAgent',
'Copy-DbaTableData',
'Copy-SqlAgentCategory',
'Copy-SqlAlert',
'Copy-SqlAudit',
'Copy-SqlAuditSpecification',
'Copy-SqlBackupDevice',
'Copy-SqlCentralManagementServer',
'Copy-SqlCredential',
'Copy-SqlCustomError',
'Copy-SqlDatabase',
'Copy-SqlDatabaseAssembly',
'Copy-SqlDatabaseMail',
'Copy-SqlDataCollector',
'Copy-SqlEndpoint',
'Copy-SqlExtendedEvent',
'Copy-SqlJob',
'Copy-SqlJobServer',
'Copy-SqlLinkedServer',
'Copy-SqlLogin',
'Copy-SqlOperator',
'Copy-SqlPolicyManagement',
'Copy-SqlProxyAccount',
'Copy-SqlResourceGovernor',
'Copy-SqlServerAgent',
'Copy-SqlServerTrigger',
'Copy-SqlSharedSchedule',
'Copy-SqlSpConfigure',
'Copy-SqlSsisCatalog',
'Copy-SqlSysDbUserObjects',
'Copy-SqlUserDefinedMessage',
'Detach-DbaDatabase',
'Expand-DbaTLogResponsibly',
'Expand-SqlTLogResponsibly',
'Export-DbaDacpac',
'Export-DbaRegisteredServer',
'Export-SqlLogin',
'Export-SqlSpConfigure',
'Export-SqlUser',
'Find-DbaDatabaseGrowthEvent',
'Find-SqlDuplicateIndex',
'Find-SqlUnusedIndex',
'Get-DbaCmsRegServerName',
'Get-DbaConfig',
'Get-DbaConfigValue',
'Get-DbaDatabaseAssembly',
'Get-DbaDatabaseCertificate',
'Get-DbaDatabaseEncryption',
'Get-DbaDatabaseFile',
'Get-DbaDatabaseFreeSpace',
'Get-DbaDatabaseMasterKey',
'Get-DbaDatabasePartitionFunction',
'Get-DbaDatabasePartitionScheme',
'Get-DbaDatabaseSnapshot',
'Get-DbaDatabaseSpace',
'Get-DbaDatabaseState',
'Get-DbaDatabaseUdf',
'Get-DbaDatabaseUser',
'Get-DbaDatabaseView',
'Get-DbaDbQueryStoreOptions',
'Get-DbaDistributor',
'Get-DbaInstance',
'Get-DbaJobCategory',
'Get-DbaLog',
'Get-DbaLogShippingError',
'Get-DbaOrphanUser',
'Get-DbaPolicy',
'Get-DbaQueryStoreConfig',
'Get-DbaRegisteredServer',
'Get-DbaRegisteredServerGroup',
'Get-DbaRegisteredServerStore',
'Get-DbaRestoreHistory',
'Get-DbaRoleMember',
'Get-DbaSqlBuildReference',
'Get-DbaSqlFeature',
'Get-DbaSqlInstanceProperty',
'Get-DbaSqlInstanceUserOption',
'Get-DbaSqlManagementObject',
'Get-DbaSqlModule',
'Get-DbaSqlProductKey',
'Get-DbaSqlRegistryRoot',
'Get-DbaSqlService',
'Get-DbaTable',
'Get-DbaTraceFile',
'Get-DbaUserLevelPermission',
'Get-DbaXEventSession',
'Get-DbaXEventSessionTarget',
'Get-DiskSpace',
'Get-SqlMaxMemory',
'Get-SqlRegisteredServerName',
'Get-SqlServerKey',
'Import-DbaCsvToSql',
'Import-DbaRegisteredServer',
'Import-SqlSpConfigure',
'Install-SqlWhoIsActive',
'Invoke-DbaCmd',
'Invoke-DbaDatabaseClone',
'Invoke-DbaDatabaseShrink',
'Invoke-DbaDatabaseUpgrade',
'Invoke-DbaLogShipping',
'Invoke-DbaLogShippingRecovery',
'Invoke-DbaSqlQuery',
'Move-DbaRegisteredServer',
'Move-DbaRegisteredServerGroup',
'New-DbaDatabaseCertificate',
'New-DbaDatabaseMasterKey',
'New-DbaDatabaseSnapshot',
'New-DbaPublishProfile',
'New-DbaSqlConnectionString',
'New-DbaSqlConnectionStringBuilder',
'New-DbaSqlDirectory',
'Out-DbaDataTable',
'Publish-DbaDacpac',
'Read-DbaXEventFile',
'Register-DbaConfig',
'Remove-DbaDatabaseCertificate',
'Remove-DbaDatabaseMasterKey',
'Remove-DbaDatabaseSnapshot',
'Remove-DbaOrphanUser',
'Remove-DbaRegisteredServer',
'Remove-DbaRegisteredServerGroup',
'Remove-SqlDatabaseSafely',
'Remove-SqlOrphanUser',
'Repair-DbaOrphanUser',
'Repair-SqlOrphanUser',
'Reset-SqlAdmin',
'Reset-SqlSaPassword',
'Restart-DbaSqlService',
'Restore-DbaDatabaseCertificate',
'Restore-DbaDatabaseSnapshot',
'Restore-HallengrenBackup',
'Restore-SqlBackupFromDirectory',
'Set-DbaConfig',
'Set-DbaDatabaseOwner',
'Set-DbaDatabaseState',
'Set-DbaDbQueryStoreOptions',
'Set-DbaJobOwner',
'Set-DbaQueryStoreConfig',
'Set-DbaTempDbConfiguration',
'Set-SqlMaxMemory',
'Set-SqlTempDbConfiguration',
'Show-DbaDatabaseList',
'Show-SqlDatabaseList',
'Show-SqlMigrationConstraint',
'Show-SqlServerFileSystem',
'Show-SqlWhoIsActive',
'Start-DbaSqlService',
'Start-SqlMigration',
'Stop-DbaSqlService',
'Sync-DbaSqlLoginPermission',
'Sync-SqlLoginPermissions',
'Test-DbaDatabaseCollation',
'Test-DbaDatabaseCompatibility',
'Test-DbaDatabaseOwner',
'Test-DbaFullRecoveryModel',
'Test-DbaJobOwner',
'Test-DbaLogShippingStatus',
'Test-DbaRecoveryModel',
'Test-DbaSqlBuild',
'Test-DbaSqlManagementObject',
'Test-DbaSqlPath',
'Test-DbaTempDbConfiguration',
'Test-DbaValidLogin',
'Test-DbaVirtualLogFile',
'Test-SqlConnection',
'Test-SqlDiskAllocation',
'Test-SqlMigrationConstraint',
'Test-SqlNetworkLatency',
'Test-SqlPath',
'Test-SqlTempDbConfiguration',
'Update-DbaSqlServiceAccount',
'Watch-DbaXEventSession',
'Watch-SqlDbLogin'
)

# List of all modules packaged with this module
ModuleList = @()
Expand Down
22 changes: 11 additions & 11 deletions dbatools.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -1415,18 +1415,26 @@ $script:xplat = @(
'Invoke-DbaDbDbccCleanTable',
'Invoke-DbaDbDbccUpdateUsage',
'Get-DbaDbIdentity',
'Set-DbaDbIdentity'
'Set-DbaDbIdentity',
'Get-DbaCmsRegServer',
'Get-DbaCmsRegServerStore',
'Add-DbaCmsRegServer',
'Add-DbaCmsRegServerGroup',
'Export-DbaCmsRegServer',
'Import-DbaCmsRegServer',
'Move-DbaCmsRegServer',
'Move-DbaCmsRegServerGroup',
'Remove-DbaCmsRegServer',
'Remove-DbaCmsRegServerGroup'
)

$script:noncoresmo = @(
# SMO issues
'Export-DbaUser',
'Get-DbaSsisExecutionHistory',
'Get-DbaRepDistributor',
'Get-DbaCmsRegServerStore',
'Copy-DbaPolicyManagement',
'Copy-DbaDataCollector',
'Get-DbaCmsRegServer',
'Copy-DbaSsisCatalog',
'New-DbaSsisCatalog',
'Get-DbaSsisEnvironmentVariable',
Expand All @@ -1436,14 +1444,6 @@ $script:noncoresmo = @(
'Get-DbaPbmObjectSet',
'Get-DbaPbmPolicy',
'Get-DbaPbmStore',
'Add-DbaCmsRegServer',
'Add-DbaCmsRegServerGroup',
'Export-DbaCmsRegServer',
'Import-DbaCmsRegServer',
'Move-DbaCmsRegServer',
'Move-DbaCmsRegServerGroup',
'Remove-DbaCmsRegServer',
'Remove-DbaCmsRegServerGroup',
'Get-DbaRepPublication',
'Test-DbaRepLatency',
'Export-DbaRepServerSetting',
Expand Down
16 changes: 10 additions & 6 deletions internal/scripts/smoLibraryImport.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ $scriptBlock = {
[string]$Name
)
$DllRoot = (Resolve-Path -Path $DllRoot)

if (-not $DoCopy) {
return
}
Expand All @@ -30,7 +30,7 @@ $scriptBlock = {

Copy-Item -Path (Resolve-Path -Path "$ModuleRoot\bin\smo\$Name.dll") -Destination $DllRoot
}

#region Names
if ($PSVersionTable.PSEdition -eq "Core") {
$names = @(
Expand All @@ -53,7 +53,11 @@ $scriptBlock = {
'Microsoft.SqlServer.Dac',
'Microsoft.SqlServer.Dac.Extensions',
'Microsoft.SqlServer.TransactSql.ScriptDom',
'Microsoft.SqlServer.Types'
'Microsoft.SqlServer.Types',
'Microsoft.SqlServer.Management.RegisteredServers',
'Microsoft.SqlTools.Hosting',
'Microsoft.SqlTools.ManagedBatchParser',
'System.Data.SqlClient'
)
} else {
$names = @(
Expand All @@ -74,7 +78,7 @@ $scriptBlock = {
'Microsoft.SqlServer.Management.UtilityEnum',
'Microsoft.SqlServer.Management.HadrDMF',
'Microsoft.SqlServer.VulnerabilityAssessment.Model',

'Microsoft.SqlServer.BatchParser',
'Microsoft.SqlServer.BatchParserClient',
'Microsoft.SqlServer.BulkInsertTaskConnections',
Expand All @@ -99,7 +103,7 @@ $scriptBlock = {
'Microsoft.SqlServer.Rmo',
'Microsoft.SqlServer.DTSPipelineWrap',
'Microsoft.SqlServer.ScriptTask',

'Accessibility',
'EnvDTE',
'Microsoft.AnalysisServices.AppLocal.Core',
Expand All @@ -115,7 +119,7 @@ $scriptBlock = {
'Microsoft.SqlServer.DataProfilingTask',
'Microsoft.SqlServer.Diagnostics.STrace',
'Microsoft.SqlServer.Dmf.Common',

'Microsoft.SqlServer.DMQueryTask',
'Microsoft.SqlServer.DTEnum',
'Microsoft.SqlServer.Dts.Design',
Expand Down

0 comments on commit d94ea3f

Please sign in to comment.