From adc6a8b46e70bc4235e5a428fa4cf9bbaf3d0774 Mon Sep 17 00:00:00 2001 From: Chrissy LeMaire Date: Sat, 19 Oct 2024 10:52:13 +0200 Subject: [PATCH] remove type check --- .aider/prompts/fix-parms.ps1 | 13 +- tests/Add-DbaAgDatabase.Tests.ps1 | 44 ++--- tests/Add-DbaAgListener.Tests.ps1 | 42 ++--- tests/Add-DbaAgReplica.Tests.ps1 | 40 ++--- tests/Add-DbaComputerCertificate.Tests.ps1 | 18 +- tests/Add-DbaDbMirrorMonitor.Tests.ps1 | 10 +- tests/Add-DbaDbRoleMember.Tests.ps1 | 14 +- tests/Add-DbaExtendedProperty.Tests.ps1 | 14 +- tests/Add-DbaPfDataCollectorCounter.Tests.ps1 | 14 +- tests/Add-DbaRegServer.Tests.ps1 | 26 +-- tests/Add-DbaRegServerGroup.Tests.ps1 | 16 +- tests/Add-DbaReplArticle.Tests.ps1 | 18 +- tests/Add-DbaServerRoleMember.Tests.ps1 | 14 +- tests/Backup-DbaComputerCertificate.Tests.ps1 | 12 +- tests/Backup-DbaDatabase.Tests.ps1 | 75 ++++---- tests/Backup-DbaDbCertificate.Tests.ps1 | 28 +-- tests/Backup-DbaDbMasterKey.Tests.ps1 | 34 ++-- tests/Backup-DbaServiceMasterKey.Tests.ps1 | 16 +- tests/Clear-DbaConnectionPool.Tests.ps1 | 10 +- tests/Clear-DbaLatchStatistics.Tests.ps1 | 10 +- tests/Clear-DbaPlanCache.Tests.ps1 | 18 +- tests/Clear-DbaWaitStatistics.Tests.ps1 | 12 +- tests/Connect-DbaInstance.Tests.ps1 | 64 +++---- tests/Convert-DbaLsn.Tests.ps1 | 4 +- tests/Convert-DbaMaskingValue.Tests.ps1 | 8 +- tests/ConvertTo-DbaDataTable.Tests.ps1 | 12 +- tests/ConvertTo-DbaTimeline.Tests.ps1 | 6 +- tests/ConvertTo-DbaXESession.Tests.ps1 | 8 +- tests/Copy-DbaAgentAlert.Tests.ps1 | 18 +- tests/Copy-DbaAgentJob.Tests.ps1 | 22 +-- tests/Copy-DbaAgentJobCategory.Tests.ps1 | 20 +-- tests/Copy-DbaAgentOperator.Tests.ps1 | 16 +- tests/Copy-DbaAgentProxy.Tests.ps1 | 16 +- tests/Copy-DbaAgentSchedule.Tests.ps1 | 18 +- tests/Copy-DbaAgentServer.Tests.ps1 | 18 +- tests/Copy-DbaBackupDevice.Tests.ps1 | 14 +- tests/Copy-DbaCredential.Tests.ps1 | 22 +-- tests/Copy-DbaCustomError.Tests.ps1 | 16 +- tests/Copy-DbaDataCollector.Tests.ps1 | 18 +- tests/Copy-DbaDatabase.Tests.ps1 | 12 +- tests/Copy-DbaDbAssembly.Tests.ps1 | 18 +- tests/Copy-DbaDbCertificate.Tests.ps1 | 26 +-- tests/Copy-DbaDbMail.Tests.ps1 | 14 +- tests/Copy-DbaDbQueryStoreOption.Tests.ps1 | 18 +- tests/Copy-DbaDbTableData.Tests.ps1 | 48 +++--- tests/Copy-DbaDbViewData.Tests.ps1 | 42 ++--- tests/Copy-DbaEndpoint.Tests.ps1 | 16 +- tests/Copy-DbaInstanceAudit.Tests.ps1 | 18 +- ...py-DbaInstanceAuditSpecification.Tests.ps1 | 16 +- tests/Copy-DbaInstanceTrigger.Tests.ps1 | 16 +- tests/Copy-DbaLinkedServer.Tests.ps1 | 20 +-- tests/Copy-DbaLogin.Tests.ps1 | 34 ++-- tests/Copy-DbaPolicyManagement.Tests.ps1 | 20 +-- tests/Copy-DbaRegServer.Tests.ps1 | 16 +- tests/Copy-DbaResourceGovernor.Tests.ps1 | 16 +- tests/Copy-DbaSpConfigure.Tests.ps1 | 14 +- tests/Copy-DbaSsisCatalog.Tests.ps1 | 22 +-- tests/Copy-DbaStartupProcedure.Tests.ps1 | 16 +- tests/Copy-DbaSystemDbUserObject.Tests.ps1 | 14 +- tests/Copy-DbaXESession.Tests.ps1 | 16 +- tests/Copy-DbaXESessionTemplate.Tests.ps1 | 10 +- tests/Disable-DbaAgHadr.Tests.ps1 | 8 +- tests/Disable-DbaDbEncryption.Tests.ps1 | 12 +- tests/Disable-DbaFilestream.Tests.ps1 | 10 +- ...isable-DbaForceNetworkEncryption.Tests.ps1 | 6 +- tests/Disable-DbaHideInstance.Tests.ps1 | 6 +- tests/Disable-DbaReplDistributor.Tests.ps1 | 8 +- tests/Disable-DbaReplPublishing.Tests.ps1 | 8 +- tests/Disable-DbaStartupProcedure.Tests.ps1 | 10 +- tests/Disable-DbaTraceFlag.Tests.ps1 | 8 +- tests/Disconnect-DbaInstance.Tests.ps1 | 8 +- tests/Dismount-DbaDatabase.Tests.ps1 | 14 +- tests/Enable-DbaAgHadr.Tests.ps1 | 8 +- tests/Enable-DbaDbEncryption.Tests.ps1 | 24 +-- tests/Enable-DbaFilestream.Tests.ps1 | 14 +- ...Enable-DbaForceNetworkEncryption.Tests.ps1 | 6 +- tests/Enable-DbaHideInstance.Tests.ps1 | 6 +- tests/Enable-DbaReplDistributor.Tests.ps1 | 12 +- tests/Enable-DbaReplPublishing.Tests.ps1 | 14 +- tests/Enable-DbaStartupProcedure.Tests.ps1 | 8 +- tests/Enable-DbaTraceFlag.Tests.ps1 | 8 +- tests/Expand-DbaDbLogFile.Tests.ps1 | 24 +-- tests/Export-DbaBinaryFile.Tests.ps1 | 24 +-- tests/Export-DbaCredential.Tests.ps1 | 34 ++-- tests/Export-DbaDacPackage.Tests.ps1 | 48 +++--- tests/Export-DbaDbRole.Tests.ps1 | 36 ++-- tests/Export-DbaDbTableData.Tests.ps1 | 20 +-- tests/Export-DbaDiagnosticQuery.Tests.ps1 | 14 +- tests/Export-DbaExecutionPlan.Tests.ps1 | 18 +- tests/Export-DbaInstance.Tests.ps1 | 32 ++-- tests/Export-DbaLinkedServer.Tests.ps1 | 20 +-- tests/Export-DbaLogin.Tests.ps1 | 42 ++--- ...rt-DbaPfDataCollectorSetTemplate.Tests.ps1 | 14 +- tests/Export-DbaRegServer.Tests.ps1 | 20 +-- tests/Export-DbaReplServerSetting.Tests.ps1 | 36 ++-- tests/Export-DbaScript.Tests.ps1 | 22 +-- tests/Export-DbaServerRole.Tests.ps1 | 34 ++-- tests/Export-DbaSpConfigure.Tests.ps1 | 10 +- tests/Export-DbaSysDbUserObject.Tests.ps1 | 22 +-- tests/Export-DbaUser.Tests.ps1 | 34 ++-- tests/Export-DbaXECsv.Tests.ps1 | 8 +- tests/Export-DbaXESession.Tests.ps1 | 26 +-- tests/Export-DbaXESessionTemplate.Tests.ps1 | 26 +-- tests/Export-DbatoolsConfig.Tests.ps1 | 20 +-- tests/Find-DbaAgentJob.Tests.ps1 | 28 +-- tests/Find-DbaBackup.Tests.ps1 | 10 +- tests/Find-DbaCommand.Tests.ps1 | 14 +- tests/Find-DbaDatabase.Tests.ps1 | 12 +- tests/Find-DbaDbDisabledIndex.Tests.ps1 | 14 +- tests/Find-DbaDbDuplicateIndex.Tests.ps1 | 10 +- tests/Find-DbaDbGrowthEvent.Tests.ps1 | 16 +- tests/Find-DbaDbUnusedIndex.Tests.ps1 | 20 +-- tests/Find-DbaInstance.Tests.ps1 | 38 ++-- tests/Find-DbaLoginInGroup.Tests.ps1 | 8 +- tests/Find-DbaOrphanedFile.Tests.ps1 | 16 +- tests/Find-DbaSimilarTable.Tests.ps1 | 34 ++-- tests/Find-DbaStoredProcedure.Tests.ps1 | 16 +- tests/Find-DbaTrigger.Tests.ps1 | 18 +- tests/Find-DbaUserObject.Tests.ps1 | 8 +- tests/Find-DbaView.Tests.ps1 | 16 +- tests/Format-DbaBackupInformation.Tests.ps1 | 28 +-- tests/Get-DbaAgBackupHistory.Tests.ps1 | 62 +++---- tests/Get-DbaAgDatabase.Tests.ps1 | 12 +- tests/Get-DbaAgHadr.Tests.ps1 | 6 +- tests/Get-DbaAgListener.Tests.ps1 | 18 +- tests/Get-DbaAgReplica.Tests.ps1 | 12 +- tests/Get-DbaAgentAlert.Tests.ps1 | 10 +- tests/Get-DbaAgentAlertCategory.Tests.ps1 | 8 +- tests/Get-DbaAgentJob.Tests.ps1 | 22 +-- tests/Get-DbaAgentJobCategory.Tests.ps1 | 10 +- tests/Get-DbaAgentJobHistory.Tests.ps1 | 22 +-- tests/Get-DbaAgentJobOutputFile.Tests.ps1 | 10 +- tests/Get-DbaAgentJobStep.Tests.ps1 | 14 +- tests/Get-DbaAgentLog.Tests.ps1 | 8 +- tests/Get-DbaAgentOperator.Tests.ps1 | 10 +- tests/Get-DbaAgentProxy.Tests.ps1 | 12 +- tests/Get-DbaAgentSchedule.Tests.ps1 | 12 +- tests/Get-DbaAgentServer.Tests.ps1 | 6 +- tests/Get-DbaAvailabilityGroup.Tests.ps1 | 10 +- tests/Get-DbaAvailableCollation.Tests.ps1 | 6 +- tests/Get-DbaBackupDevice.Tests.ps1 | 10 +- tests/Get-DbaBackupInformation.Tests.ps1 | 36 ++-- tests/Get-DbaBinaryFileTable.Tests.ps1 | 14 +- tests/Get-DbaBuild.Tests.ps1 | 18 +- tests/Get-DbaClientAlias.Tests.ps1 | 10 +- tests/Get-DbaClientProtocol.Tests.ps1 | 6 +- tests/Get-DbaCmConnection.Tests.ps1 | 10 +- tests/Get-DbaCmObject.Tests.ps1 | 36 ++-- tests/Get-DbaComputerCertificate.Tests.ps1 | 16 +- tests/Get-DbaComputerSystem.Tests.ps1 | 8 +- tests/Get-DbaConnection.Tests.ps1 | 10 +- tests/Get-DbaCpuRingBuffer.Tests.ps1 | 8 +- tests/Get-DbaCpuUsage.Tests.ps1 | 10 +- tests/Get-DbaCredential.Tests.ps1 | 14 +- tests/Get-DbaCustomError.Tests.ps1 | 10 +- tests/Get-DbaDBFileGroup.Tests.ps1 | 12 +- tests/Get-DbaDatabase.Tests.ps1 | 56 +++--- tests/Get-DbaDbAssembly.Tests.ps1 | 10 +- tests/Get-DbaDbAsymmetricKey.Tests.ps1 | 16 +- tests/Get-DbaDbBackupHistory.Tests.ps1 | 42 ++--- tests/Get-DbaDbCertificate.Tests.ps1 | 16 +- tests/Get-DbaDbCheckConstraint.Tests.ps1 | 12 +- tests/Get-DbaDbCompatibility.Tests.ps1 | 10 +- tests/Get-DbaDbCompression.Tests.ps1 | 12 +- tests/Get-DbaDbDbccOpenTran.Tests.ps1 | 8 +- tests/Get-DbaDbDetachedFileInfo.Tests.ps1 | 8 +- tests/Get-DbaDbEncryption.Tests.ps1 | 12 +- tests/Get-DbaDbEncryptionKey.Tests.ps1 | 12 +- tests/Get-DbaDbExtentDiff.Tests.ps1 | 12 +- tests/Get-DbaDbFeatureUsage.Tests.ps1 | 12 +- tests/Get-DbaDbFile.Tests.ps1 | 14 +- tests/Get-DbaDbFileGrowth.Tests.ps1 | 10 +- tests/Get-DbaDbFileMapping.Tests.ps1 | 10 +- tests/Get-DbaDbForeignKey.Tests.ps1 | 12 +- tests/Get-DbaDbIdentity.Tests.ps1 | 10 +- tests/Get-DbaDbLogShipError.Tests.ps1 | 20 +-- tests/Get-DbaDbLogSpace.Tests.ps1 | 20 +-- tests/Get-DbaDbMail.Tests.ps1 | 10 +- tests/Get-DbaDbMailAccount.Tests.ps1 | 22 +-- tests/Get-DbaDbMailConfig.Tests.ps1 | 18 +- tests/Get-DbaDbMailHistory.Tests.ps1 | 10 +- tests/Get-DbaDbMailLog.Tests.ps1 | 3 - tests/Get-DbaDbMailProfile.Tests.ps1 | 12 +- tests/Get-DbaDbMailServer.Tests.ps1 | 22 +-- tests/Get-DbaDbMasterKey.Tests.ps1 | 12 +- tests/Get-DbaDbMemoryUsage.Tests.ps1 | 12 +- tests/Get-DbaDbMirror.Tests.ps1 | 8 +- tests/Get-DbaDbMirrorMonitor.Tests.ps1 | 14 +- tests/Get-DbaDbObjectTrigger.Tests.ps1 | 3 - tests/Get-DbaDbOrphanUser.Tests.ps1 | 18 +- tests/Get-DbaDbPageInfo.Tests.ps1 | 26 +-- tests/Get-DbaDbPartitionFunction.Tests.ps1 | 22 +-- tests/Get-DbaDbPartitionScheme.Tests.ps1 | 22 +-- tests/Get-DbaDbQueryStoreOption.Tests.ps1 | 10 +- tests/Get-DbaDbRecoveryModel.Tests.ps1 | 12 +- tests/Get-DbaDbRestoreHistory.Tests.ps1 | 18 +- tests/Get-DbaDbRole.Tests.ps1 | 18 +- tests/Get-DbaDbRoleMember.Tests.ps1 | 20 +-- tests/Get-DbaDbSchema.Tests.ps1 | 24 +-- tests/Get-DbaDbSequence.Tests.ps1 | 14 +- tests/Get-DbaDbServiceBrokerQueue.Tests.ps1 | 12 +- tests/Get-DbaDbServiceBrokerService.Tests.ps1 | 12 +- tests/Get-DbaDbSharePoint.Tests.ps1 | 10 +- tests/Get-DbaDbSnapshot.Tests.ps1 | 14 +- tests/Get-DbaDbSpace.Tests.ps1 | 14 +- tests/Get-DbaDbState.Tests.ps1 | 10 +- tests/Get-DbaDbStoredProcedure.Tests.ps1 | 32 ++-- tests/Get-DbaDbSynonym.Tests.ps1 | 20 +-- tests/Get-DbaDbTable.Tests.ps1 | 18 +- tests/Get-DbaDbTrigger.Tests.ps1 | 12 +- tests/Get-DbaDbUdf.Tests.ps1 | 20 +-- tests/Get-DbaDbUser.Tests.ps1 | 16 +- tests/Get-DbaDbUserDefinedTableType.Tests.ps1 | 12 +- tests/Get-DbaDbView.Tests.ps1 | 18 +- tests/Get-DbaDbVirtualLogFile.Tests.ps1 | 12 +- tests/Get-DbaDbccHelp.Tests.ps1 | 16 +- tests/Get-DbaDbccMemoryStatus.Tests.ps1 | 6 +- tests/Get-DbaDbccProcCache.Tests.ps1 | 6 +- tests/Get-DbaDbccSessionBuffer.Tests.ps1 | 14 +- tests/Get-DbaDbccStatistic.Tests.ps1 | 16 +- tests/Get-DbaDbccUserOption.Tests.ps1 | 14 +- tests/Get-DbaDefaultPath.Tests.ps1 | 6 +- tests/Get-DbaDependency.Tests.ps1 | 10 +- tests/Get-DbaDeprecatedFeature.Tests.ps1 | 10 +- tests/Get-DbaDiskSpace.Tests.ps1 | 16 +- tests/Get-DbaDump.Tests.ps1 | 6 +- tests/Get-DbaEndpoint.Tests.ps1 | 10 +- tests/Get-DbaErrorLog.Tests.ps1 | 16 +- tests/Get-DbaErrorLogConfig.Tests.ps1 | 6 +- .../Get-DbaEstimatedCompletionTime.Tests.ps1 | 10 +- tests/Get-DbaExecutionPlan.Tests.ps1 | 18 +- tests/Get-DbaExtendedProperty.Tests.ps1 | 16 +- tests/Get-DbaExtendedProtection.Tests.ps1 | 10 +- tests/Get-DbaExternalProcess.Tests.ps1 | 6 +- tests/Get-DbaFeature.Tests.ps1 | 6 +- tests/Get-DbaFile.Tests.ps1 | 22 +-- tests/Get-DbaFilestream.Tests.ps1 | 14 +- tests/Get-DbaFirewallRule.Tests.ps1 | 8 +- tests/Get-DbaForceNetworkEncryption.Tests.ps1 | 6 +- tests/Get-DbaHelpIndex.Tests.ps1 | 22 +-- tests/Get-DbaHideInstance.Tests.ps1 | 6 +- tests/Get-DbaInstalledPatch.Tests.ps1 | 10 +- tests/Get-DbaInstanceAudit.Tests.ps1 | 10 +- ...et-DbaInstanceAuditSpecification.Tests.ps1 | 6 +- tests/Get-DbaInstanceInstallDate.Tests.ps1 | 10 +- tests/Get-DbaInstanceProperty.Tests.ps1 | 10 +- tests/Get-DbaInstanceProtocol.Tests.ps1 | 10 +- tests/Get-DbaInstanceTrigger.Tests.ps1 | 6 +- tests/Get-DbaInstanceUserOption.Tests.ps1 | 6 +- tests/Get-DbaIoLatency.Tests.ps1 | 6 +- tests/Get-DbaKbUpdate.Tests.ps1 | 8 +- tests/Get-DbaLastBackup.Tests.ps1 | 10 +- tests/Get-DbaLastGoodCheckDb.Tests.ps1 | 12 +- tests/Get-DbaLatchStatistic.Tests.ps1 | 8 +- tests/Get-DbaLinkedServer.Tests.ps1 | 10 +- tests/Get-DbaLinkedServerLogin.Tests.ps1 | 14 +- tests/Get-DbaLocaleSetting.Tests.ps1 | 10 +- tests/Get-DbaLogin.Tests.ps1 | 28 +-- tests/Get-DbaMaintenanceSolutionLog.Tests.ps1 | 12 +- tests/Get-DbaManagementObject.Tests.ps1 | 8 +- tests/Get-DbaMaxMemory.Tests.ps1 | 6 +- tests/Get-DbaMemoryCondition.Tests.ps1 | 6 +- tests/Get-DbaMemoryUsage.Tests.ps1 | 16 +- tests/Get-DbaModule.Tests.ps1 | 20 +-- tests/Get-DbaMsdtc.Tests.ps1 | 6 +- tests/Get-DbaNetworkActivity.Tests.ps1 | 10 +- tests/Get-DbaNetworkCertificate.Tests.ps1 | 6 +- tests/Get-DbaNetworkConfiguration.Tests.ps1 | 8 +- tests/Get-DbaOleDbProvider.Tests.ps1 | 14 +- tests/Get-DbaOpenTransaction.Tests.ps1 | 6 +- tests/Get-DbaOperatingSystem.Tests.ps1 | 6 +- tests/Get-DbaPageFileSetting.Tests.ps1 | 10 +- tests/Get-DbaPbmCategory.Tests.ps1 | 12 +- .../Get-DbaPbmCategorySubscription.Tests.ps1 | 14 +- tests/Get-DbaPbmCondition.Tests.ps1 | 22 +-- tests/Get-DbaPbmObjectSet.Tests.ps1 | 12 +- tests/Get-DbaPbmPolicy.Tests.ps1 | 14 +- tests/Get-DbaPbmStore.Tests.ps1 | 6 +- tests/Get-DbaPermission.Tests.ps1 | 14 +- tests/Get-DbaPfAvailableCounter.Tests.ps1 | 10 +- tests/Get-DbaPfDataCollector.Tests.ps1 | 12 +- tests/Get-DbaPfDataCollectorCounter.Tests.ps1 | 14 +- ...-DbaPfDataCollectorCounterSample.Tests.ps1 | 22 +-- tests/Get-DbaPfDataCollectorSet.Tests.ps1 | 14 +- ...et-DbaPfDataCollectorSetTemplate.Tests.ps1 | 16 +- tests/Get-DbaPlanCache.Tests.ps1 | 6 +- tests/Get-DbaPowerPlan.Tests.ps1 | 8 +- tests/Get-DbaPrivilege.Tests.ps1 | 10 +- tests/Get-DbaProcess.Tests.ps1 | 20 +-- tests/Get-DbaProductKey.Tests.ps1 | 14 +- tests/Get-DbaQueryExecutionTime.Tests.ps1 | 32 ++-- tests/Get-DbaRandomizedDataset.Tests.ps1 | 22 +-- ...Get-DbaRandomizedDatasetTemplate.Tests.ps1 | 12 +- tests/Get-DbaRandomizedType.Tests.ps1 | 14 +- tests/Get-DbaRandomizedValue.Tests.ps1 | 52 +++--- tests/Get-DbaRegServer.Tests.ps1 | 22 +-- tests/Get-DbaRegServerGroup.Tests.ps1 | 12 +- tests/Get-DbaRegServerStore.Tests.ps1 | 6 +- tests/Get-DbaRegistryRoot.Tests.ps1 | 10 +- tests/Get-DbaReplArticle.Tests.ps1 | 26 +-- tests/Get-DbaReplArticleColumn.Tests.ps1 | 26 +-- tests/Get-DbaReplDistributor.Tests.ps1 | 6 +- tests/Get-DbaReplPublication.Tests.ps1 | 13 +- tests/Get-DbaReplPublisher.Tests.ps1 | 6 +- tests/Get-DbaReplServer.Tests.ps1 | 6 +- tests/Get-DbaReplSubscription.Tests.ps1 | 16 +- tests/Get-DbaResourceGovernor.Tests.ps1 | 6 +- tests/Get-DbaRgClassifierFunction.Tests.ps1 | 8 +- tests/Get-DbaRgResourcePool.Tests.ps1 | 3 - tests/Get-DbaRgWorkloadGroup.Tests.ps1 | 14 +- tests/Get-DbaRunningJob.Tests.ps1 | 14 +- tests/Get-DbaSchemaChangeHistory.Tests.ps1 | 26 +-- tests/Get-DbaServerRole.Tests.ps1 | 12 +- tests/Get-DbaServerRoleMember.Tests.ps1 | 14 +- tests/Get-DbaService.Tests.ps1 | 16 +- tests/Get-DbaSpConfigure.Tests.ps1 | 10 +- tests/Get-DbaSpinLockStatistic.Tests.ps1 | 6 +- tests/Get-DbaSpn.Tests.ps1 | 8 +- .../Get-DbaSsisEnvironmentVariable.Tests.ps1 | 14 +- tests/Get-DbaSsisExecutionHistory.Tests.ps1 | 16 +- tests/Get-DbaStartupParameter.Tests.ps1 | 12 +- tests/Get-DbaStartupProcedure.Tests.ps1 | 8 +- tests/Get-DbaSuspectPage.Tests.ps1 | 12 +- tests/Get-DbaTcpPort.Tests.ps1 | 12 +- tests/Get-DbaTempdbUsage.Tests.ps1 | 6 +- tests/Get-DbaTopResourceUsage.Tests.ps1 | 28 +-- tests/Get-DbaTrace.Tests.ps1 | 10 +- tests/Get-DbaTraceFlag.Tests.ps1 | 8 +- tests/Get-DbaUpTime.Tests.ps1 | 8 +- tests/Get-DbaUserPermission.Tests.ps1 | 18 +- tests/Get-DbaWaitResource.Tests.ps1 | 10 +- tests/Get-DbaWaitStatistic.Tests.ps1 | 10 +- tests/Get-DbaWaitingTask.Tests.ps1 | 10 +- tests/Get-DbaWindowsLog.Tests.ps1 | 14 +- tests/Get-DbaWsfcAvailableDisk.Tests.ps1 | 10 +- tests/Get-DbaWsfcCluster.Tests.ps1 | 6 +- tests/Get-DbaWsfcDisk.Tests.ps1 | 10 +- tests/Get-DbaWsfcNetwork.Tests.ps1 | 6 +- tests/Get-DbaWsfcNetworkInterface.Tests.ps1 | 6 +- tests/Get-DbaWsfcNode.Tests.ps1 | 10 +- tests/Get-DbaWsfcResource.Tests.ps1 | 10 +- tests/Get-DbaWsfcResourceGroup.Tests.ps1 | 14 +- tests/Get-DbaWsfcResourceType.Tests.ps1 | 6 +- tests/Get-DbaWsfcRole.Tests.ps1 | 6 +- tests/Get-DbaWsfcSharedVolume.Tests.ps1 | 6 +- tests/Get-DbaXEObject.Tests.ps1 | 8 +- tests/Get-DbaXESession.Tests.ps1 | 14 +- tests/Get-DbaXESessionTarget.Tests.ps1 | 22 +-- tests/Get-DbaXESessionTargetFile.Tests.ps1 | 12 +- tests/Get-DbaXESessionTemplate.Tests.ps1 | 16 +- tests/Get-DbaXESmartTarget.Tests.ps1 | 4 +- tests/Get-DbaXEStore.Tests.ps1 | 6 +- tests/Get-DbatoolsChangeLog.Tests.ps1 | 4 +- tests/Get-DbatoolsConfig.Tests.ps1 | 16 +- tests/Get-DbatoolsConfigValue.Tests.ps1 | 6 +- tests/Get-DbatoolsError.Tests.ps1 | 8 +- tests/Get-DbatoolsLog.Tests.ps1 | 44 ++--- tests/Get-DbatoolsPath.Tests.ps1 | 2 +- tests/Get-DirectoryRestoreFile.Tests.ps1 | 6 +- tests/Get-ObjectNameParts.Tests.ps1 | 4 +- tests/Get-SqlDefaultSpConfigure.Tests.ps1 | 4 +- tests/Get-XpDirTreeRestoreFile.Tests.ps1 | 10 +- tests/Grant-DbaAgPermission.Tests.ps1 | 16 +- tests/Import-DbaBinaryFile.Tests.ps1 | 26 +-- tests/Import-DbaCsv.Tests.ps1 | 74 ++++---- ...rt-DbaPfDataCollectorSetTemplate.Tests.ps1 | 40 ++--- tests/Import-DbaRegServer.Tests.ps1 | 12 +- tests/Import-DbaSpConfigure.Tests.ps1 | 18 +- tests/Import-DbaXESessionTemplate.Tests.ps1 | 18 +- tests/Import-DbatoolsConfig.Tests.ps1 | 32 ++-- tests/InModule.Commands.Tests.ps1 | 2 +- tests/InModule.Help.Tests.ps1 | 10 -- tests/Install-DbaAgentAdminAlert.Tests.ps1 | 32 ++-- tests/Install-DbaDarlingData.Tests.ps1 | 16 +- tests/Install-DbaFirstResponderKit.Tests.ps1 | 16 +- tests/Install-DbaInstance.Tests.ps1 | 70 ++++---- .../Install-DbaMaintenanceSolution.Tests.ps1 | 32 ++-- tests/Install-DbaMultiTool.Tests.ps1 | 14 +- tests/Install-DbaSqlWatch.Tests.ps1 | 14 +- tests/Install-DbaWhoIsActive.Tests.ps1 | 6 - tests/Invoke-DbaAdvancedInstall.Tests.ps1 | 32 ++-- tests/Invoke-DbaAdvancedRestore.Tests.ps1 | 44 ++--- tests/Invoke-DbaAdvancedUpdate.Tests.ps1 | 32 ++-- tests/Invoke-DbaAgFailover.Tests.ps1 | 12 +- tests/Invoke-DbaAzSqlDbTip.Tests.ps1 | 26 +-- tests/Invoke-DbaBalanceDataFiles.Tests.ps1 | 14 +- tests/Invoke-DbaCycleErrorLog.Tests.ps1 | 8 +- tests/Invoke-DbaDbClone.Tests.ps1 | 18 +- tests/Invoke-DbaDbCorruption.Tests.ps1 | 10 +- tests/Invoke-DbaDbDataGenerator.Tests.ps1 | 28 +-- tests/Invoke-DbaDbDataMasking.Tests.ps1 | 38 ++-- .../Invoke-DbaDbDbccCheckConstraint.Tests.ps1 | 16 +- tests/Invoke-DbaDbDbccCleanTable.Tests.ps1 | 14 +- tests/Invoke-DbaDbDbccUpdateUsage.Tests.ps1 | 16 +- tests/Invoke-DbaDbDecryptObject.Tests.ps1 | 14 +- tests/Invoke-DbaDbLogShipRecovery.Tests.ps1 | 16 +- tests/Invoke-DbaDbLogShipping.Tests.ps1 | 162 +++++++++--------- tests/Invoke-DbaDbMirrorFailover.Tests.ps1 | 12 +- tests/Invoke-DbaDbMirroring.Tests.ps1 | 28 +-- tests/Invoke-DbaDbPiiScan.Tests.ps1 | 30 ++-- tests/Invoke-DbaDbShrink.Tests.ps1 | 26 +-- tests/Invoke-DbaDbTransfer.Tests.ps1 | 32 ++-- tests/Invoke-DbaDbUpgrade.Tests.ps1 | 24 +-- tests/Invoke-DbaDbccDropCleanBuffer.Tests.ps1 | 8 +- tests/Invoke-DbaDbccFreeCache.Tests.ps1 | 22 +-- tests/Invoke-DbaDiagnosticQuery.Tests.ps1 | 32 ++-- tests/Invoke-DbaPfRelog.Tests.ps1 | 68 ++++---- tests/Invoke-DbaQuery.Tests.ps1 | 32 ++-- tests/Invoke-DbaWhoisActive.Tests.ps1 | 58 +++---- tests/Invoke-DbaXEReplay.Tests.ps1 | 14 +- tests/Invoke-DbatoolsFormatter.Tests.ps1 | 4 +- tests/Invoke-DbatoolsRenameHelper.Tests.ps1 | 6 +- tests/Join-DbaAvailabilityGroup.Tests.ps1 | 12 +- tests/Join-DbaPath.Tests.ps1 | 6 +- tests/Measure-DbaBackupThroughput.Tests.ps1 | 18 +- tests/Measure-DbaDbVirtualLogFile.Tests.ps1 | 20 +-- .../Measure-DbaDiskSpaceRequirement.Tests.ps1 | 16 +- tests/Mount-DbaDatabase.Tests.ps1 | 14 +- tests/Move-DbaDbFile.Tests.ps1 | 20 +-- tests/Move-DbaRegServer.Tests.ps1 | 14 +- tests/Move-DbaRegServerGroup.Tests.ps1 | 12 +- tests/New-DbaAgentAlert.Tests.ps1 | 38 ++-- tests/New-DbaAgentAlertCategory.Tests.ps1 | 16 +- tests/New-DbaAgentJob.Tests.ps1 | 38 ++-- tests/New-DbaAgentJobCategory.Tests.ps1 | 12 +- tests/New-DbaAgentJobStep.Tests.ps1 | 46 ++--- tests/New-DbaAgentOperator.Tests.ps1 | 36 ++-- tests/New-DbaAgentProxy.Tests.ps1 | 24 +-- tests/New-DbaAgentSchedule.Tests.ps1 | 36 ++-- tests/New-DbaAvailabilityGroup.Tests.ps1 | 68 ++++---- tests/New-DbaAzAccessToken.Tests.ps1 | 30 ++-- tests/New-DbaClientAlias.Tests.ps1 | 14 +- tests/New-DbaCmConnection.Tests.ps1 | 26 +-- tests/New-DbaComputerCertificate.Tests.ps1 | 34 ++-- ...omputerCertificateSigningRequest.Tests.ps1 | 30 ++-- tests/New-DbaConnectionString.Tests.ps1 | 90 +++++----- .../New-DbaConnectionStringBuilder.Tests.ps1 | 26 +-- tests/New-DbaCredential.Tests.ps1 | 18 +- tests/New-DbaCustomError.Tests.ps1 | 16 +- tests/New-DbaDacOption.Tests.ps1 | 20 +-- tests/New-DbaDacProfile.Tests.ps1 | 14 +- tests/New-DbaDatabase.Tests.ps1 | 46 ++--- tests/New-DbaDbAsymmetricKey.Tests.ps1 | 40 ++--- tests/New-DbaDbCertificate.Tests.ps1 | 38 ++-- tests/New-DbaDbDataGeneratorConfig.Tests.ps1 | 32 ++-- tests/New-DbaDbEncryptionKey.Tests.ps1 | 18 +- tests/New-DbaDbFileGroup.Tests.ps1 | 14 +- tests/New-DbaDbMailAccount.Tests.ps1 | 36 ++-- tests/New-DbaDbMailProfile.Tests.ps1 | 28 +-- tests/New-DbaDbMaskingConfig.Tests.ps1 | 56 +++--- tests/New-DbaDbMasterKey.Tests.ps1 | 14 +- tests/New-DbaDbRole.Tests.ps1 | 16 +- tests/New-DbaDbSchema.Tests.ps1 | 20 +-- tests/New-DbaDbSequence.Tests.ps1 | 28 +-- tests/New-DbaDbSnapshot.Tests.ps1 | 22 +-- tests/New-DbaDbSynonym.Tests.ps1 | 24 +-- tests/New-DbaDbTable.Tests.ps1 | 14 +- tests/New-DbaDbTransfer.Tests.ps1 | 30 ++-- tests/New-DbaDbUser.Tests.ps1 | 24 +-- tests/New-DbaDiagnosticAdsNotebook.Tests.ps1 | 12 +- tests/New-DbaDirectory.Tests.ps1 | 18 +- tests/New-DbaEndpoint.Tests.ps1 | 34 ++-- tests/New-DbaFirewallRule.Tests.ps1 | 12 +- tests/New-DbaLinkedServer.Tests.ps1 | 28 +-- tests/New-DbaLinkedServerLogin.Tests.ps1 | 18 +- tests/New-DbaLogin.Tests.ps1 | 44 ++--- ...New-DbaReplCreationScriptOptions.Tests.ps1 | 6 +- tests/New-DbaReplPublication.Tests.ps1 | 14 +- tests/New-DbaReplSubscription.Tests.ps1 | 22 +-- tests/New-DbaRgResourcePool.Tests.ps1 | 30 ++-- tests/New-DbaRgWorkloadGroup.Tests.ps1 | 28 +-- tests/New-DbaScriptingOption.Tests.ps1 | 4 +- tests/New-DbaServerRole.Tests.ps1 | 12 +- tests/New-DbaServiceMasterKey.Tests.ps1 | 10 +- tests/New-DbaSqlParameter.Tests.ps1 | 80 ++++----- tests/New-DbaSsisCatalog.Tests.ps1 | 12 +- tests/New-DbaXESession.Tests.ps1 | 18 +- tests/New-DbaXESmartCsvWriter.Tests.ps1 | 12 +- tests/New-DbaXESmartEmail.Tests.ps1 | 28 +-- tests/New-DbaXESmartQueryExec.Tests.ps1 | 14 +- tests/New-DbaXESmartReplay.Tests.ps1 | 18 +- tests/New-DbaXESmartTableWriter.Tests.ps1 | 36 ++-- tests/New-DbatoolsSupportPackage.Tests.ps1 | 24 +-- tests/Publish-DbaDacPackage.Tests.ps1 | 28 +-- tests/Read-DbaAuditFile.Tests.ps1 | 6 +- tests/Read-DbaBackupHeader.Tests.ps1 | 14 +- tests/Read-DbaTraceFile.Tests.ps1 | 30 ++-- tests/Read-DbaTransactionLog.Tests.ps1 | 12 +- tests/Read-DbaXEFile.Tests.ps1 | 6 +- tests/Register-DbatoolsConfig.Tests.ps1 | 12 +- tests/Remove-DbaAgDatabase.Tests.ps1 | 12 +- tests/Remove-DbaAgListener.Tests.ps1 | 12 +- tests/Remove-DbaAgReplica.Tests.ps1 | 16 +- tests/Remove-DbaAgentAlert.Tests.ps1 | 12 +- tests/Remove-DbaAgentAlertCategory.Tests.ps1 | 18 +- tests/Remove-DbaAgentJob.Tests.ps1 | 14 +- tests/Remove-DbaAgentJobCategory.Tests.ps1 | 22 +-- tests/Remove-DbaAgentJobStep.Tests.ps1 | 14 +- tests/Remove-DbaAgentOperator.Tests.ps1 | 24 +-- tests/Remove-DbaAgentProxy.Tests.ps1 | 12 +- tests/Remove-DbaAgentSchedule.Tests.ps1 | 16 +- tests/Remove-DbaAvailabilityGroup.Tests.ps1 | 12 +- tests/Remove-DbaBackup.Tests.ps1 | 12 +- tests/Remove-DbaClientAlias.Tests.ps1 | 8 +- tests/Remove-DbaCmConnection.Tests.ps1 | 8 +- tests/Remove-DbaComputerCertificate.Tests.ps1 | 12 +- tests/Remove-DbaCredential.Tests.ps1 | 16 +- tests/Remove-DbaCustomError.Tests.ps1 | 10 +- tests/Remove-DbaDatabase.Tests.ps1 | 10 +- tests/Remove-DbaDatabaseSafely.Tests.ps1 | 46 ++--- tests/Remove-DbaDbAsymmetricKey.Tests.ps1 | 14 +- ...Remove-DbaDbBackupRestoreHistory.Tests.ps1 | 12 +- tests/Remove-DbaDbCertificate.Tests.ps1 | 12 +- tests/Remove-DbaDbCheckConstraint.Tests.ps1 | 14 +- tests/Remove-DbaDbData.Tests.ps1 | 14 +- tests/Remove-DbaDbEncryptionKey.Tests.ps1 | 10 +- tests/Remove-DbaDbFileGroup.Tests.ps1 | 12 +- tests/Remove-DbaDbLogShipping.Tests.ps1 | 14 +- tests/Remove-DbaDbMailAccount.Tests.ps1 | 12 +- tests/Remove-DbaDbMailProfile.Tests.ps1 | 12 +- tests/Remove-DbaDbMasterKey.Tests.ps1 | 14 +- tests/Remove-DbaDbMirror.Tests.ps1 | 14 +- tests/Remove-DbaDbMirrorMonitor.Tests.ps1 | 6 +- tests/Remove-DbaDbOrphanUser.Tests.ps1 | 14 +- tests/Remove-DbaDbPartitionFunction.Tests.ps1 | 12 +- tests/Remove-DbaDbPartitionScheme.Tests.ps1 | 16 +- tests/Remove-DbaDbRole.Tests.ps1 | 18 +- tests/Remove-DbaDbRoleMember.Tests.ps1 | 24 +-- tests/Remove-DbaDbSchema.Tests.ps1 | 12 +- tests/Remove-DbaDbSequence.Tests.ps1 | 14 +- tests/Remove-DbaDbSnapshot.Tests.ps1 | 18 +- tests/Remove-DbaDbSynonym.Tests.ps1 | 20 +-- tests/Remove-DbaDbTable.Tests.ps1 | 12 +- tests/Remove-DbaDbTableData.Tests.ps1 | 48 +++--- tests/Remove-DbaDbUdf.Tests.ps1 | 40 ++--- tests/Remove-DbaDbUser.Tests.ps1 | 16 +- tests/Remove-DbaDbView.Tests.ps1 | 12 +- tests/Remove-DbaEndpoint.Tests.ps1 | 12 +- tests/Remove-DbaExtendedProperty.Tests.ps1 | 24 +-- tests/Remove-DbaFirewallRule.Tests.ps1 | 10 +- tests/Remove-DbaLinkedServer.Tests.ps1 | 12 +- tests/Remove-DbaLinkedServerLogin.Tests.ps1 | 12 +- tests/Remove-DbaLogin.Tests.ps1 | 12 +- tests/Remove-DbaNetworkCertificate.Tests.ps1 | 10 +- ...Remove-DbaPfDataCollectorCounter.Tests.ps1 | 18 +- tests/Remove-DbaPfDataCollectorSet.Tests.ps1 | 10 +- tests/Remove-DbaRegServer.Tests.ps1 | 20 +-- tests/Remove-DbaRegServerGroup.Tests.ps1 | 16 +- tests/Remove-DbaReplArticle.Tests.ps1 | 16 +- tests/Remove-DbaReplPublication.Tests.ps1 | 12 +- tests/Remove-DbaReplSubscription.Tests.ps1 | 20 +-- tests/Remove-DbaRgResourcePool.Tests.ps1 | 14 +- tests/Remove-DbaRgWorkloadGroup.Tests.ps1 | 16 +- tests/Remove-DbaServerRole.Tests.ps1 | 10 +- tests/Remove-DbaServerRoleMember.Tests.ps1 | 14 +- tests/Remove-DbaSpn.Tests.ps1 | 12 +- tests/Remove-DbaTrace.Tests.ps1 | 10 +- tests/Remove-DbaXESession.Tests.ps1 | 12 +- tests/Remove-DbaXESmartTarget.Tests.ps1 | 8 +- tests/Rename-DbaDatabase.Tests.ps1 | 34 ++-- tests/Rename-DbaLogin.Tests.ps1 | 12 +- tests/Repair-DbaDbMirror.Tests.ps1 | 22 +-- tests/Repair-DbaDbOrphanUser.Tests.ps1 | 24 +-- tests/Repair-DbaInstanceName.Tests.ps1 | 10 +- tests/Reset-DbaAdmin.Tests.ps1 | 12 +- tests/Reset-DbatoolsConfig.Tests.ps1 | 22 +-- tests/Resolve-DbaNetworkName.Tests.ps1 | 8 +- tests/Resolve-DbaPath.Tests.ps1 | 8 +- tests/Restart-DbaService.Tests.ps1 | 18 +- tests/Restore-DbaDatabase.Tests.ps1 | 102 +++++------ tests/Restore-DbaDbCertificate.Tests.ps1 | 18 +- tests/Restore-DbaDbSnapshot.Tests.ps1 | 16 +- tests/Resume-DbaAgDbDataMovement.Tests.ps1 | 12 +- tests/Revoke-DbaAgPermission.Tests.ps1 | 16 +- tests/Save-DbaCommunitySoftware.Tests.ps1 | 24 +-- tests/Save-DbaDiagnosticQueryScript.Tests.ps1 | 6 +- tests/Save-DbaKbUpdate.Tests.ps1 | 28 +-- tests/Select-DbaBackupInformation.Tests.ps1 | 30 ++-- tests/Select-DbaDbSequenceNextValue.Tests.ps1 | 14 +- tests/Select-DbaObject.Tests.ps1 | 36 ++-- tests/Set-DbaAgListener.Tests.ps1 | 18 +- tests/Set-DbaAgReplica.Tests.ps1 | 32 ++-- tests/Set-DbaAgentAlert.Tests.ps1 | 18 +- tests/Set-DbaAgentJob.Tests.ps1 | 46 ++--- tests/Set-DbaAgentJobCategory.Tests.ps1 | 12 +- tests/Set-DbaAgentJobOutputFile.Tests.ps1 | 12 +- tests/Set-DbaAgentJobOwner.Tests.ps1 | 14 +- tests/Set-DbaAgentJobStep.Tests.ps1 | 8 +- tests/Set-DbaAgentOperator.Tests.ps1 | 36 ++-- tests/Set-DbaAgentSchedule.Tests.ps1 | 38 ++-- tests/Set-DbaAgentServer.Tests.ps1 | 48 +++--- tests/Set-DbaAvailabilityGroup.Tests.ps1 | 32 ++-- tests/Set-DbaCmConnection.Tests.ps1 | 42 ++--- tests/Set-DbaDbCompatibility.Tests.ps1 | 16 +- tests/Set-DbaDbCompression.Tests.ps1 | 22 +-- tests/Set-DbaDbFileGroup.Tests.ps1 | 18 +- tests/Set-DbaDbFileGrowth.Tests.ps1 | 16 +- tests/Set-DbaDbIdentity.Tests.ps1 | 12 +- tests/Set-DbaDbMirror.Tests.ps1 | 18 +- tests/Set-DbaDbOwner.Tests.ps1 | 14 +- tests/Set-DbaDbQueryStoreOption.Tests.ps1 | 38 ++-- tests/Set-DbaDbRecoveryModel.Tests.ps1 | 16 +- tests/Set-DbaDbSchema.Tests.ps1 | 14 +- tests/Set-DbaDbSequence.Tests.ps1 | 28 +-- tests/Set-DbaDbState.Tests.ps1 | 34 ++-- tests/Set-DbaDefaultPath.Tests.ps1 | 10 +- tests/Set-DbaEndpoint.Tests.ps1 | 16 +- tests/Set-DbaErrorLogConfig.Tests.ps1 | 10 +- tests/Set-DbaExtendedProperty.Tests.ps1 | 14 +- tests/Set-DbaExtendedProtection.Tests.ps1 | 8 +- tests/Set-DbaLogin.Tests.ps1 | 38 ++-- tests/Set-DbaMaxDop.Tests.ps1 | 16 +- tests/Set-DbaMaxMemory.Tests.ps1 | 10 +- tests/Set-DbaNetworkCertificate.Tests.ps1 | 12 +- tests/Set-DbaNetworkConfiguration.Tests.ps1 | 34 ++-- tests/Set-DbaPowerPlan.Tests.ps1 | 8 +- tests/Set-DbaPrivilege.Tests.ps1 | 10 +- tests/Set-DbaResourceGovernor.Tests.ps1 | 22 +-- tests/Set-DbaRgResourcePool.Tests.ps1 | 30 ++-- tests/Set-DbaRgWorkloadGroup.Tests.ps1 | 28 +-- tests/Set-DbaSpConfigure.Tests.ps1 | 12 +- tests/Set-DbaSpn.Tests.ps1 | 10 +- tests/Set-DbaStartupParameter.Tests.ps1 | 46 ++--- tests/Set-DbaTcpPort.Tests.ps1 | 12 +- tests/Set-DbaTempDbConfig.Tests.ps1 | 26 +-- tests/Set-DbatoolsConfig.Tests.ps1 | 76 ++++---- .../Set-DbatoolsInsecureConnection.Tests.ps1 | 6 +- tests/Set-DbatoolsPath.Tests.ps1 | 12 +- tests/Show-DbaDbList.Tests.ps1 | 12 +- tests/Show-DbaInstanceFileSystem.Tests.ps1 | 6 +- tests/Start-DbaAgentJob.Tests.ps1 | 24 +-- tests/Start-DbaDbEncryption.Tests.ps1 | 32 ++-- tests/Start-DbaEndpoint.Tests.ps1 | 18 +- tests/Start-DbaMigration.Tests.ps1 | 50 +++--- tests/Start-DbaPfDataCollectorSet.Tests.ps1 | 20 +-- tests/Start-DbaService.Tests.ps1 | 16 +- tests/Start-DbaTrace.Tests.ps1 | 10 +- tests/Start-DbaXESession.Tests.ps1 | 18 +- tests/Start-DbaXESmartTarget.Tests.ps1 | 18 +- tests/Stop-DbaAgentJob.Tests.ps1 | 14 +- tests/Stop-DbaDbEncryption.Tests.ps1 | 6 +- tests/Stop-DbaEndpoint.Tests.ps1 | 14 +- tests/Stop-DbaExternalProcess.Tests.ps1 | 8 +- tests/Stop-DbaPfDataCollectorSet.Tests.ps1 | 12 +- tests/Stop-DbaProcess.Tests.ps1 | 20 +-- tests/Stop-DbaService.Tests.ps1 | 18 +- tests/Stop-DbaTrace.Tests.ps1 | 10 +- tests/Stop-DbaXESession.Tests.ps1 | 12 +- tests/Stop-DbaXESmartTarget.Tests.ps1 | 4 +- tests/Stop-Function.Tests.ps1 | 28 +-- tests/Suspend-DbaAgDbDataMovement.Tests.ps1 | 22 +-- tests/Sync-DbaAvailabilityGroup.Tests.ps1 | 28 +-- tests/Sync-DbaLoginPermission.Tests.ps1 | 14 +- tests/Test-DbaAgSpn.Tests.ps1 | 14 +- tests/Test-DbaAgentJobOwner.Tests.ps1 | 12 +- tests/Test-DbaAvailabilityGroup.Tests.ps1 | 20 +-- tests/Test-DbaBackupEncrypted.Tests.ps1 | 8 +- tests/Test-DbaBackupInformation.Tests.ps1 | 16 +- tests/Test-DbaBuild.Tests.ps1 | 18 +- tests/Test-DbaCmConnection.Tests.ps1 | 10 +- ...DbaComputerCertificateExpiration.Tests.ps1 | 34 ++-- tests/Test-DbaConnection.Tests.ps1 | 10 +- tests/Test-DbaConnectionAuthScheme.Tests.ps1 | 10 +- tests/Test-DbaDbCollation.Tests.ps1 | 14 +- tests/Test-DbaDbCompatibility.Tests.ps1 | 10 +- tests/Test-DbaDbCompression.Tests.ps1 | 40 ++--- tests/Test-DbaDbDataGeneratorConfig.Tests.ps1 | 4 +- tests/Test-DbaDbDataMaskingConfig.Tests.ps1 | 4 +- tests/Test-DbaDbLogShipStatus.Tests.ps1 | 16 +- tests/Test-DbaDbOwner.Tests.ps1 | 14 +- tests/Test-DbaDbQueryStore.Tests.ps1 | 12 +- tests/Test-DbaDbRecoveryModel.Tests.ps1 | 12 +- tests/Test-DbaDeprecatedFeature.Tests.ps1 | 12 +- tests/Test-DbaDiskAlignment.Tests.ps1 | 16 +- tests/Test-DbaDiskAllocation.Tests.ps1 | 10 +- tests/Test-DbaDiskSpeed.Tests.ps1 | 12 +- tests/Test-DbaEndpoint.Tests.ps1 | 10 +- tests/Test-DbaIdentityUsage.Tests.ps1 | 14 +- tests/Test-DbaInstanceName.Tests.ps1 | 8 +- tests/Test-DbaLastBackup.Tests.ps1 | 54 +++--- .../Test-DbaLinkedServerConnection.Tests.ps1 | 6 +- tests/Test-DbaLoginPassword.Tests.ps1 | 12 +- tests/Test-DbaLsnChain.Tests.ps1 | 6 +- tests/Test-DbaManagementObject.Tests.ps1 | 14 +- tests/Test-DbaMaxDop.Tests.ps1 | 6 +- tests/Test-DbaMaxMemory.Tests.ps1 | 8 +- tests/Test-DbaMigrationConstraint.Tests.ps1 | 14 +- tests/Test-DbaNetworkLatency.Tests.ps1 | 10 +- tests/Test-DbaOptimizeForAdHoc.Tests.ps1 | 6 +- tests/Test-DbaPath.Tests.ps1 | 8 +- tests/Test-DbaPowerPlan.Tests.ps1 | 8 +- tests/Test-DbaReplLatency.Tests.ps1 | 16 +- tests/Test-DbaSpn.Tests.ps1 | 10 +- tests/Test-DbaTempDbConfig.Tests.ps1 | 6 +- tests/Test-DbaWindowsLogin.Tests.ps1 | 16 +- tests/Test-PSRemoting.Tests.ps1 | 6 +- tests/Uninstall-DbaSqlWatch.Tests.ps1 | 8 +- tests/Unregister-DbatoolsConfig.Tests.ps1 | 10 +- tests/Update-DbaBuildReference.Tests.ps1 | 4 +- tests/Update-DbaInstance.Tests.ps1 | 28 +-- tests/Update-DbaMaintenanceSolution.Tests.ps1 | 14 +- tests/Update-DbaServiceAccount.Tests.ps1 | 20 +-- tests/Update-dbatools.Tests.ps1 | 6 +- tests/Watch-DbaDbLogin.Tests.ps1 | 16 +- tests/Watch-DbaXESession.Tests.ps1 | 12 +- tests/Write-DbaDbTableData.Tests.ps1 | 38 ++-- tests/dbatools.Tests.ps1 | 2 +- 707 files changed, 6219 insertions(+), 6247 deletions(-) diff --git a/.aider/prompts/fix-parms.ps1 b/.aider/prompts/fix-parms.ps1 index 880f5014f6..9df931bf00 100644 --- a/.aider/prompts/fix-parms.ps1 +++ b/.aider/prompts/fix-parms.ps1 @@ -1,4 +1,4 @@ -# loop through all files in the tests directory that matches HaveParameter +<# loop through all files in the tests directory that matches HaveParameter $tests = Get-ChildItem -Path /workspace/tests -Filter *.Tests.ps1 $prompt = "When testing HaveParameter, we should have used type full names and we used type short names.Consult types.md and apply the appropriate replacements. Do not remove any arrays ([]), just replace the type names." @@ -8,3 +8,14 @@ foreach ($test in $tests) { Write-Host "Processing $test" aider --message "$prompt" --file $test.FullName --model azure/gpt-4o-mini --no-stream --cache-prompts --read /workspace/.aider/prompts/types.md } +#> + +$tests = Get-ChildItem -Path /workspace/tests -Filter *.Tests.ps1 + +$prompt = "This is a Pester v5 test suite. 1. Remove -Type test in HaveParameter tests. 2. Remove -Mandatory test in HaveParameter test. 2. Remove all -Mandatory:`$false from the HaveParameter test." + + +foreach ($test in $tests) { + Write-Host "Processing $test" + aider --message "$prompt" --file $test.FullName --model azure/gpt-4o-mini --no-stream +} \ No newline at end of file diff --git a/tests/Add-DbaAgDatabase.Tests.ps1 b/tests/Add-DbaAgDatabase.Tests.ps1 index fa4f620c8a..857442a11b 100644 --- a/tests/Add-DbaAgDatabase.Tests.ps1 +++ b/tests/Add-DbaAgDatabase.Tests.ps1 @@ -11,41 +11,41 @@ Describe "Add-DbaAgDatabase" { BeforeAll { $CommandUnderTest = Get-Command Add-DbaAgDatabase } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have AvailabilityGroup as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String -Mandatory:$false + It "Should have AvailabilityGroup as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } - It "Should have Database as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have Secondary as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter Secondary -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have Secondary as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Secondary } - It "Should have SecondarySqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SecondarySqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SecondarySqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SecondarySqlCredential } - It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } - It "Should have SeedingMode as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter SeedingMode -Type System.String -Mandatory:$false + It "Should have SeedingMode as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SeedingMode } - It "Should have SharedPath as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter SharedPath -Type System.String -Mandatory:$false + It "Should have SharedPath as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SharedPath } It "Should have UseLastBackup as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter UseLastBackup -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter UseLastBackup } - It "Should have AdvancedBackupParams as a non-mandatory parameter of type System.Collections.Hashtable" { - $CommandUnderTest | Should -HaveParameter AdvancedBackupParams -Type System.Collections.Hashtable -Mandatory:$false + It "Should have AdvancedBackupParams as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter AdvancedBackupParams } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Add-DbaAgListener.Tests.ps1 b/tests/Add-DbaAgListener.Tests.ps1 index cea5f0fc5c..f2e3e18f23 100644 --- a/tests/Add-DbaAgListener.Tests.ps1 +++ b/tests/Add-DbaAgListener.Tests.ps1 @@ -11,41 +11,41 @@ Describe "Add-DbaAgListener" { BeforeAll { $CommandUnderTest = Get-Command Add-DbaAgListener } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have AvailabilityGroup as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String[] -Mandatory:$false + It "Should have AvailabilityGroup as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } - It "Should have Name as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String -Mandatory:$false + It "Should have Name as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Name } - It "Should have IPAddress as a non-mandatory parameter of type System.Net.IPAddress[]" { - $CommandUnderTest | Should -HaveParameter IPAddress -Type System.Net.IPAddress[] -Mandatory:$false + It "Should have IPAddress as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter IPAddress } - It "Should have SubnetIP as a non-mandatory parameter of type System.Net.IPAddress[]" { - $CommandUnderTest | Should -HaveParameter SubnetIP -Type System.Net.IPAddress[] -Mandatory:$false + It "Should have SubnetIP as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SubnetIP } - It "Should have SubnetMask as a non-mandatory parameter of type System.Net.IPAddress[]" { - $CommandUnderTest | Should -HaveParameter SubnetMask -Type System.Net.IPAddress[] -Mandatory:$false + It "Should have SubnetMask as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SubnetMask } - It "Should have Port as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter Port -Type System.Int32 -Mandatory:$false + It "Should have Port as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Port } It "Should have Dhcp as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Dhcp -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Dhcp } It "Should have Passthru as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Passthru } - It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.AvailabilityGroup[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityGroup[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Add-DbaAgReplica.Tests.ps1 b/tests/Add-DbaAgReplica.Tests.ps1 index b58361844f..59c2bfef3c 100644 --- a/tests/Add-DbaAgReplica.Tests.ps1 +++ b/tests/Add-DbaAgReplica.Tests.ps1 @@ -11,64 +11,64 @@ Describe "Add-DbaAgReplica" { $CommandUnderTest = Get-Command Add-DbaAgReplica } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Name parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String + $CommandUnderTest | Should -HaveParameter Name } It "Should have ClusterType parameter" { - $CommandUnderTest | Should -HaveParameter ClusterType -Type System.String + $CommandUnderTest | Should -HaveParameter ClusterType } It "Should have AvailabilityMode parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityMode -Type System.String + $CommandUnderTest | Should -HaveParameter AvailabilityMode } It "Should have FailoverMode parameter" { - $CommandUnderTest | Should -HaveParameter FailoverMode -Type System.String + $CommandUnderTest | Should -HaveParameter FailoverMode } It "Should have BackupPriority parameter" { - $CommandUnderTest | Should -HaveParameter BackupPriority -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BackupPriority } It "Should have ConnectionModeInPrimaryRole parameter" { - $CommandUnderTest | Should -HaveParameter ConnectionModeInPrimaryRole -Type System.String + $CommandUnderTest | Should -HaveParameter ConnectionModeInPrimaryRole } It "Should have ConnectionModeInSecondaryRole parameter" { - $CommandUnderTest | Should -HaveParameter ConnectionModeInSecondaryRole -Type System.String + $CommandUnderTest | Should -HaveParameter ConnectionModeInSecondaryRole } It "Should have SeedingMode parameter" { - $CommandUnderTest | Should -HaveParameter SeedingMode -Type System.String + $CommandUnderTest | Should -HaveParameter SeedingMode } It "Should have Endpoint parameter" { - $CommandUnderTest | Should -HaveParameter Endpoint -Type System.String + $CommandUnderTest | Should -HaveParameter Endpoint } It "Should have EndpointUrl parameter" { - $CommandUnderTest | Should -HaveParameter EndpointUrl -Type System.String[] + $CommandUnderTest | Should -HaveParameter EndpointUrl } It "Should have Passthru parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Passthru } It "Should have ReadOnlyRoutingList parameter" { - $CommandUnderTest | Should -HaveParameter ReadOnlyRoutingList -Type System.String[] + $CommandUnderTest | Should -HaveParameter ReadOnlyRoutingList } It "Should have ReadonlyRoutingConnectionUrl parameter" { - $CommandUnderTest | Should -HaveParameter ReadonlyRoutingConnectionUrl -Type System.String + $CommandUnderTest | Should -HaveParameter ReadonlyRoutingConnectionUrl } It "Should have Certificate parameter" { - $CommandUnderTest | Should -HaveParameter Certificate -Type System.String + $CommandUnderTest | Should -HaveParameter Certificate } It "Should have ConfigureXESession parameter" { - $CommandUnderTest | Should -HaveParameter ConfigureXESession -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ConfigureXESession } It "Should have SessionTimeout parameter" { - $CommandUnderTest | Should -HaveParameter SessionTimeout -Type System.Int32 + $CommandUnderTest | Should -HaveParameter SessionTimeout } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityGroup + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Add-DbaComputerCertificate.Tests.ps1 b/tests/Add-DbaComputerCertificate.Tests.ps1 index f8024e1a48..3d5754cd16 100644 --- a/tests/Add-DbaComputerCertificate.Tests.ps1 +++ b/tests/Add-DbaComputerCertificate.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Add-DbaComputerCertificate" { $CommandUnderTest = Get-Command Add-DbaComputerCertificate } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have SecurePassword as a parameter" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter SecurePassword } It "Should have Certificate as a parameter" { - $CommandUnderTest | Should -HaveParameter Certificate -Type System.Security.Cryptography.X509Certificates.X509Certificate2[] + $CommandUnderTest | Should -HaveParameter Certificate } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have Store as a parameter" { - $CommandUnderTest | Should -HaveParameter Store -Type System.String + $CommandUnderTest | Should -HaveParameter Store } It "Should have Folder as a parameter" { - $CommandUnderTest | Should -HaveParameter Folder -Type System.String + $CommandUnderTest | Should -HaveParameter Folder } It "Should have Flag as a parameter" { - $CommandUnderTest | Should -HaveParameter Flag -Type System.String[] + $CommandUnderTest | Should -HaveParameter Flag } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Add-DbaDbMirrorMonitor.Tests.ps1 b/tests/Add-DbaDbMirrorMonitor.Tests.ps1 index dbeaa090a1..85369d78e3 100644 --- a/tests/Add-DbaDbMirrorMonitor.Tests.ps1 +++ b/tests/Add-DbaDbMirrorMonitor.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Add-DbaDbMirrorMonitor" { $CommandUnderTest = Get-Command Add-DbaDbMirrorMonitor } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Confirm } } diff --git a/tests/Add-DbaDbRoleMember.Tests.ps1 b/tests/Add-DbaDbRoleMember.Tests.ps1 index 40afa74d65..20564768f1 100644 --- a/tests/Add-DbaDbRoleMember.Tests.ps1 +++ b/tests/Add-DbaDbRoleMember.Tests.ps1 @@ -27,25 +27,25 @@ Describe "Add-DbaDbRoleMember" { Context "Validate parameters" { It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Role as a parameter" { - $CommandUnderTest | Should -HaveParameter Role -Type System.String[] + $CommandUnderTest | Should -HaveParameter Role } It "Should have Member as a parameter" { - $CommandUnderTest | Should -HaveParameter Member -Type System.String[] + $CommandUnderTest | Should -HaveParameter Member } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Add-DbaExtendedProperty.Tests.ps1 b/tests/Add-DbaExtendedProperty.Tests.ps1 index af78697e31..c8d0a90bc5 100644 --- a/tests/Add-DbaExtendedProperty.Tests.ps1 +++ b/tests/Add-DbaExtendedProperty.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Add-DbaExtendedProperty" { $CommandUnderTest = Get-Command Add-DbaExtendedProperty } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Name } It "Should have Value as a parameter" { - $CommandUnderTest | Should -HaveParameter Value -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Value } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Management.Automation.PSObject[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Add-DbaPfDataCollectorCounter.Tests.ps1 b/tests/Add-DbaPfDataCollectorCounter.Tests.ps1 index 8c6e9847de..24e4d8e47b 100644 --- a/tests/Add-DbaPfDataCollectorCounter.Tests.ps1 +++ b/tests/Add-DbaPfDataCollectorCounter.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Add-DbaPfDataCollectorCounter" { $CommandUnderTest = Get-Command Add-DbaPfDataCollectorCounter } It "Should have ComputerName as a non-mandatory Dataplat.Dbatools.Parameter.DbaInstanceParameter[] parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a non-mandatory System.Management.Automation.PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have CollectorSet as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter CollectorSet -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CollectorSet } It "Should have Collector as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter Collector -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Collector } It "Should have Counter as a non-mandatory System.Object[] parameter" { - $CommandUnderTest | Should -HaveParameter Counter -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Counter } It "Should have InputObject as a non-mandatory System.Object[] parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Add-DbaRegServer.Tests.ps1 b/tests/Add-DbaRegServer.Tests.ps1 index 326a01830e..8c697d0ac8 100644 --- a/tests/Add-DbaRegServer.Tests.ps1 +++ b/tests/Add-DbaRegServer.Tests.ps1 @@ -6,43 +6,43 @@ Describe "Add-DbaRegServer" { $CommandUnderTest = Get-Command Add-DbaRegServer } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have ServerName as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter ServerName -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ServerName } It "Should have Name as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Name } It "Should have Description as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Description -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Description } It "Should have Group as a non-mandatory parameter of type System.Object" { - $CommandUnderTest | Should -HaveParameter Group -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Group } It "Should have ActiveDirectoryTenant as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter ActiveDirectoryTenant -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ActiveDirectoryTenant } It "Should have ActiveDirectoryUserId as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter ActiveDirectoryUserId -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ActiveDirectoryUserId } It "Should have ConnectionString as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter ConnectionString -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ConnectionString } It "Should have OtherParams as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter OtherParams -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OtherParams } It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.RegisteredServers.ServerGroup[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.RegisteredServers.ServerGroup[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have ServerObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Server[]" { - $CommandUnderTest | Should -HaveParameter ServerObject -Type Microsoft.SqlServer.Management.Smo.Server[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ServerObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Add-DbaRegServerGroup.Tests.ps1 b/tests/Add-DbaRegServerGroup.Tests.ps1 index df23a69b64..aec68bdd31 100644 --- a/tests/Add-DbaRegServerGroup.Tests.ps1 +++ b/tests/Add-DbaRegServerGroup.Tests.ps1 @@ -11,25 +11,25 @@ Describe "Add-DbaRegServerGroup" { $CommandUnderTest = Get-Command Add-DbaRegServerGroup } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String + $CommandUnderTest | Should -HaveParameter Name } It "Should have Description as a parameter" { - $CommandUnderTest | Should -HaveParameter Description -Type System.String + $CommandUnderTest | Should -HaveParameter Description } It "Should have Group as a parameter" { - $CommandUnderTest | Should -HaveParameter Group -Type System.String + $CommandUnderTest | Should -HaveParameter Group } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.RegisteredServers.ServerGroup[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -41,7 +41,7 @@ Describe "Add-DbaRegServerGroup" { $descriptionUpdated = "group description updated" } AfterAll { - Get-DbaRegServerGroup -SqlInstance $global:instance1 | Where-Object Name -match dbatoolsci | Remove-DbaRegServerGroup -Confirm:$false + Get-DbaRegServerGroup -SqlInstance $global:instance1 | Where-Object Name -match dbatoolsci | Remove-DbaRegServerGroup } It "adds a registered server group" { diff --git a/tests/Add-DbaReplArticle.Tests.ps1 b/tests/Add-DbaReplArticle.Tests.ps1 index 08aed8481b..9d8e428926 100644 --- a/tests/Add-DbaReplArticle.Tests.ps1 +++ b/tests/Add-DbaReplArticle.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Add-DbaReplArticle" { $CommandUnderTest = Get-Command Add-DbaReplArticle } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have Publication parameter" { - $CommandUnderTest | Should -HaveParameter Publication -Type System.String + $CommandUnderTest | Should -HaveParameter Publication } It "Should have Schema parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String + $CommandUnderTest | Should -HaveParameter Schema } It "Should have Name parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String + $CommandUnderTest | Should -HaveParameter Name } It "Should have Filter parameter" { - $CommandUnderTest | Should -HaveParameter Filter -Type System.String + $CommandUnderTest | Should -HaveParameter Filter } It "Should have CreationScriptOptions parameter" { - $CommandUnderTest | Should -HaveParameter CreationScriptOptions -Type PSObject + $CommandUnderTest | Should -HaveParameter CreationScriptOptions } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Add-DbaServerRoleMember.Tests.ps1 b/tests/Add-DbaServerRoleMember.Tests.ps1 index 0a71c33f84..a8cd8b431f 100644 --- a/tests/Add-DbaServerRoleMember.Tests.ps1 +++ b/tests/Add-DbaServerRoleMember.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Add-DbaServerRoleMember" { $CommandUnderTest = Get-Command Add-DbaServerRoleMember } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have ServerRole as a parameter" { - $CommandUnderTest | Should -HaveParameter ServerRole -Type System.String[] + $CommandUnderTest | Should -HaveParameter ServerRole } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String[] + $CommandUnderTest | Should -HaveParameter Login } It "Should have Role as a parameter" { - $CommandUnderTest | Should -HaveParameter Role -Type System.String[] + $CommandUnderTest | Should -HaveParameter Role } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Backup-DbaComputerCertificate.Tests.ps1 b/tests/Backup-DbaComputerCertificate.Tests.ps1 index dcfae60e9e..4a944be289 100644 --- a/tests/Backup-DbaComputerCertificate.Tests.ps1 +++ b/tests/Backup-DbaComputerCertificate.Tests.ps1 @@ -11,22 +11,22 @@ Describe "Backup-DbaComputerCertificate" { $CommandUnderTest = Get-Command Backup-DbaComputerCertificate } It "Should have SecurePassword as a non-mandatory SecureString parameter" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type SecureString -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SecurePassword } It "Should have InputObject as a non-mandatory System.Object[] parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Path as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have FilePath as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have Type as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type } It "Should have EnableException as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Backup-DbaDatabase.Tests.ps1 b/tests/Backup-DbaDatabase.Tests.ps1 index 63398d595f..e9ddf414ea 100644 --- a/tests/Backup-DbaDatabase.Tests.ps1 +++ b/tests/Backup-DbaDatabase.Tests.ps1 @@ -13,139 +13,139 @@ Describe "Backup-DbaDatabase Unit Tests" -Tag 'UnitTests' { } It "Should have SqlInstance parameter" { - $command | Should -HaveParameter SqlInstance -Type Microsoft.SqlServer.Management.Smo.DbaInstanceParameter -Mandatory:$false + $command | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $command | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $command | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $command | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $command | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $command | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $command | Should -HaveParameter ExcludeDatabase } It "Should have Path parameter" { - $command | Should -HaveParameter Path -Type System.String[] -Mandatory:$false + $command | Should -HaveParameter Path } It "Should have FilePath parameter" { - $command | Should -HaveParameter FilePath -Type System.String -Mandatory:$false + $command | Should -HaveParameter FilePath } It "Should have IncrementPrefix parameter" { - $command | Should -HaveParameter IncrementPrefix -Type System.Management.Automation.SwitchParameter + $command | Should -HaveParameter IncrementPrefix } It "Should have ReplaceInName parameter" { - $command | Should -HaveParameter ReplaceInName -Type System.Management.Automation.SwitchParameter + $command | Should -HaveParameter ReplaceInName } It "Should have NoAppendDbNameInPath parameter" { - $command | Should -HaveParameter NoAppendDbNameInPath -Type System.Management.Automation.SwitchParameter + $command | Should -HaveParameter NoAppendDbNameInPath } It "Should have CopyOnly parameter" { - $command | Should -HaveParameter CopyOnly -Type System.Management.Automation.SwitchParameter + $command | Should -HaveParameter CopyOnly } It "Should have Type parameter" { - $command | Should -HaveParameter Type -Type System.String -Mandatory:$false + $command | Should -HaveParameter Type } It "Should have InputObject parameter" { - $command | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $command | Should -HaveParameter InputObject } It "Should have CreateFolder parameter" { - $command | Should -HaveParameter CreateFolder -Type System.Management.Automation.SwitchParameter + $command | Should -HaveParameter CreateFolder } It "Should have FileCount parameter" { - $command | Should -HaveParameter FileCount -Type System.Int32 -Mandatory:$false + $command | Should -HaveParameter FileCount } It "Should have CompressBackup parameter" { - $command | Should -HaveParameter CompressBackup -Type System.Management.Automation.SwitchParameter + $command | Should -HaveParameter CompressBackup } It "Should have Checksum parameter" { - $command | Should -HaveParameter Checksum -Type System.Management.Automation.SwitchParameter + $command | Should -HaveParameter Checksum } It "Should have Verify parameter" { - $command | Should -HaveParameter Verify -Type System.Management.Automation.SwitchParameter + $command | Should -HaveParameter Verify } It "Should have MaxTransferSize parameter" { - $command | Should -HaveParameter MaxTransferSize -Type System.Int32 -Mandatory:$false + $command | Should -HaveParameter MaxTransferSize } It "Should have BlockSize parameter" { - $command | Should -HaveParameter BlockSize -Type System.Int32 -Mandatory:$false + $command | Should -HaveParameter BlockSize } It "Should have BufferCount parameter" { - $command | Should -HaveParameter BufferCount -Type System.Int32 -Mandatory:$false + $command | Should -HaveParameter BufferCount } It "Should have AzureBaseUrl parameter" { - $command | Should -HaveParameter AzureBaseUrl -Type System.String[] -Mandatory:$false + $command | Should -HaveParameter AzureBaseUrl } It "Should have AzureCredential parameter" { - $command | Should -HaveParameter AzureCredential -Type System.String -Mandatory:$false + $command | Should -HaveParameter AzureCredential } It "Should have NoRecovery parameter" { - $command | Should -HaveParameter NoRecovery -Type System.Management.Automation.SwitchParameter + $command | Should -HaveParameter NoRecovery } It "Should have BuildPath parameter" { - $command | Should -HaveParameter BuildPath -Type System.Management.Automation.SwitchParameter + $command | Should -HaveParameter BuildPath } It "Should have WithFormat parameter" { - $command | Should -HaveParameter WithFormat -Type System.Management.Automation.SwitchParameter + $command | Should -HaveParameter WithFormat } It "Should have Initialize parameter" { - $command | Should -HaveParameter Initialize -Type System.Management.Automation.SwitchParameter + $command | Should -HaveParameter Initialize } It "Should have SkipTapeHeader parameter" { - $command | Should -HaveParameter SkipTapeHeader -Type System.Management.Automation.SwitchParameter + $command | Should -HaveParameter SkipTapeHeader } It "Should have TimeStampFormat parameter" { - $command | Should -HaveParameter TimeStampFormat -Type System.String -Mandatory:$false + $command | Should -HaveParameter TimeStampFormat } It "Should have IgnoreFileChecks parameter" { - $command | Should -HaveParameter IgnoreFileChecks -Type System.Management.Automation.SwitchParameter + $command | Should -HaveParameter IgnoreFileChecks } It "Should have OutputScriptOnly parameter" { - $command | Should -HaveParameter OutputScriptOnly -Type System.Management.Automation.SwitchParameter + $command | Should -HaveParameter OutputScriptOnly } It "Should have EncryptionAlgorithm parameter" { - $command | Should -HaveParameter EncryptionAlgorithm -Type System.String -Mandatory:$false + $command | Should -HaveParameter EncryptionAlgorithm } It "Should have EncryptionCertificate parameter" { - $command | Should -HaveParameter EncryptionCertificate -Type System.String -Mandatory:$false + $command | Should -HaveParameter EncryptionCertificate } It "Should have Description parameter" { - $command | Should -HaveParameter Description -Type System.String -Mandatory:$false + $command | Should -HaveParameter Description } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $command | Should -HaveParameter EnableException } } } @@ -259,8 +259,6 @@ Describe "Backup-DbaDatabase Integration Tests" -Tag "IntegrationTests" { } } - - Context "Handling backup paths that don't exist" { $MissingPathTrailing = "$DestBackupDir\Missing1\Awol2\" $MissingPath = "$DestBackupDir\Missing1\Awol2" @@ -293,7 +291,6 @@ Describe "Backup-DbaDatabase Integration Tests" -Tag "IntegrationTests" { } } - Context "A fully qualified path should override a backupfolder" { $results = Backup-DbaDatabase -SqlInstance $global:instance1 -Database master -BackupDirectory c:\temp -BackupFileName "$DestBackupDir\PesterTest2.bak" It "Should report backed up to $DestBackupDir" { @@ -309,7 +306,6 @@ Describe "Backup-DbaDatabase Integration Tests" -Tag "IntegrationTests" { $backupPaths = "$DestBackupDir\stripe1", "$DestBackupDir\stripe2", "$DestBackupDir\stripe3" $null = New-Item -Path $backupPaths -ItemType Directory - $results = Backup-DbaDatabase -SqlInstance $global:instance1 -Database master -BackupDirectory $backupPaths It "Should have created 3 backups" { $results.BackupFilesCount | Should -Be 3 @@ -370,7 +366,7 @@ Describe "Backup-DbaDatabase Integration Tests" -Tag "IntegrationTests" { } } - Context "Test backup verification" { + Context "Test backup verification" { It "Should perform a full backup and verify it" { $b = Backup-DbaDatabase -SqlInstance $global:instance1 -Database master -Type full -Verify $b.BackupComplete | Should -Be $True @@ -405,7 +401,6 @@ Describe "Backup-DbaDatabase Integration Tests" -Tag "IntegrationTests" { It "Should Complete Successfully" { $results.BackupComplete | Should -Be $true } - } Context "Should handle NUL as an input path" { diff --git a/tests/Backup-DbaDbCertificate.Tests.ps1 b/tests/Backup-DbaDbCertificate.Tests.ps1 index b6c62e341e..559d7e9b6e 100644 --- a/tests/Backup-DbaDbCertificate.Tests.ps1 +++ b/tests/Backup-DbaDbCertificate.Tests.ps1 @@ -6,37 +6,37 @@ Describe "Backup-DbaDbCertificate" { $CommandUnderTest = Get-Command Backup-DbaDbCertificate } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Certificate parameter" { - $CommandUnderTest | Should -HaveParameter Certificate -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Certificate } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have EncryptionPassword parameter" { - $CommandUnderTest | Should -HaveParameter EncryptionPassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter EncryptionPassword } It "Should have DecryptionPassword parameter" { - $CommandUnderTest | Should -HaveParameter DecryptionPassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter DecryptionPassword } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.IO.FileInfo + $CommandUnderTest | Should -HaveParameter Path } It "Should have Suffix parameter" { - $CommandUnderTest | Should -HaveParameter Suffix -Type System.String + $CommandUnderTest | Should -HaveParameter Suffix } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Certificate[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -48,11 +48,11 @@ Describe "Backup-DbaDbCertificate" { $db1 = New-DbaDatabase -SqlInstance $global:instance1 -Name $db1Name $pw = ConvertTo-SecureString -String "GoodPass1234!" -AsPlainText -Force if (-not (Get-DbaDbMasterKey -SqlInstance $global:instance1 -Database $db1Name)) { - $masterkey = New-DbaDbMasterKey -SqlInstance $global:instance1 -Database $db1Name -Password $pw -Confirm:$false + $masterkey = New-DbaDbMasterKey -SqlInstance $global:instance1 -Database $db1Name -Password $pw } - $cert = New-DbaDbCertificate -SqlInstance $global:instance1 -Database $db1Name -Confirm:$false -Password $pw -Name dbatoolscli_cert1_$random - $cert2 = New-DbaDbCertificate -SqlInstance $global:instance1 -Database $db1Name -Confirm:$false -Password $pw -Name dbatoolscli_cert2_$random + $cert = New-DbaDbCertificate -SqlInstance $global:instance1 -Database $db1Name -Password $pw -Name dbatoolscli_cert1_$random + $cert2 = New-DbaDbCertificate -SqlInstance $global:instance1 -Database $db1Name -Password $pw -Name dbatoolscli_cert2_$random } AfterAll { diff --git a/tests/Backup-DbaDbMasterKey.Tests.ps1 b/tests/Backup-DbaDbMasterKey.Tests.ps1 index 6ce0b012e1..36263ccdba 100644 --- a/tests/Backup-DbaDbMasterKey.Tests.ps1 +++ b/tests/Backup-DbaDbMasterKey.Tests.ps1 @@ -5,32 +5,32 @@ Describe "Backup-DbaDbMasterKey" { BeforeAll { $CommandUnderTest = Get-Command Backup-DbaDbMasterKey } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance -Mandatory:$false } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential -Mandatory:$false } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential -Mandatory:$false } - It "Should have Database as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database -Mandatory:$false } - It "Should have ExcludeDatabase as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] -Mandatory:$false + It "Should have ExcludeDatabase as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Mandatory:$false } - It "Should have SecurePassword as a non-mandatory parameter of type System.Security.SecureString" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type System.Security.SecureString -Mandatory:$false + It "Should have SecurePassword as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SecurePassword -Mandatory:$false } - It "Should have Path as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path -Mandatory:$false } - It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException -Mandatory:$false } } diff --git a/tests/Backup-DbaServiceMasterKey.Tests.ps1 b/tests/Backup-DbaServiceMasterKey.Tests.ps1 index 222a9717be..bc6c7ddd41 100644 --- a/tests/Backup-DbaServiceMasterKey.Tests.ps1 +++ b/tests/Backup-DbaServiceMasterKey.Tests.ps1 @@ -10,28 +10,28 @@ Describe "Backup-DbaServiceMasterKey" { $CommandUnderTest = Get-Command Backup-DbaServiceMasterKey } It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have KeyCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter KeyCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter KeyCredential } It "Should have SecurePassword as a non-mandatory parameter of type System.Security.SecureString" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type System.Security.SecureString -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SecurePassword } It "Should have Path as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Confirm } } diff --git a/tests/Clear-DbaConnectionPool.Tests.ps1 b/tests/Clear-DbaConnectionPool.Tests.ps1 index beced6ceb0..5ffb097c29 100644 --- a/tests/Clear-DbaConnectionPool.Tests.ps1 +++ b/tests/Clear-DbaConnectionPool.Tests.ps1 @@ -11,14 +11,14 @@ Describe "Clear-DbaConnectionPool" { BeforeAll { $CommandUnderTest = Get-Command Clear-DbaConnectionPool } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Clear-DbaLatchStatistics.Tests.ps1 b/tests/Clear-DbaLatchStatistics.Tests.ps1 index ab668c356a..6818a8cd4b 100644 --- a/tests/Clear-DbaLatchStatistics.Tests.ps1 +++ b/tests/Clear-DbaLatchStatistics.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Clear-DbaLatchStatistics" { $CommandUnderTest = Get-Command Clear-DbaLatchStatistics } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Confirm } } diff --git a/tests/Clear-DbaPlanCache.Tests.ps1 b/tests/Clear-DbaPlanCache.Tests.ps1 index d26edfbb50..fbbb8cb79d 100644 --- a/tests/Clear-DbaPlanCache.Tests.ps1 +++ b/tests/Clear-DbaPlanCache.Tests.ps1 @@ -9,20 +9,20 @@ Describe "Clear-DbaPlanCache" { BeforeAll { $CommandUnderTest = Get-Command Clear-DbaPlanCache } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance -Mandatory:$false } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential -Mandatory:$false } - It "Should have Threshold as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter Threshold -Type System.Int32 -Mandatory:$false + It "Should have Threshold as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Threshold -Mandatory:$false } - It "Should have InputObject as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException -Mandatory:$false } } diff --git a/tests/Clear-DbaWaitStatistics.Tests.ps1 b/tests/Clear-DbaWaitStatistics.Tests.ps1 index 2e1db479af..8c5ddca789 100644 --- a/tests/Clear-DbaWaitStatistics.Tests.ps1 +++ b/tests/Clear-DbaWaitStatistics.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Clear-DbaWaitStatistics" { $CommandUnderTest = Get-Command Clear-DbaWaitStatistics } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Confirm } } @@ -28,7 +28,7 @@ Describe "Clear-DbaWaitStatistics" { . (Join-Path $PSScriptRoot 'constants.ps1') } BeforeAll { - $results = Clear-DbaWaitStatistics -SqlInstance $global:instance1 -Confirm:$false + $results = Clear-DbaWaitStatistics -SqlInstance $global:instance1 } It "returns success" { $results.Status | Should -Be 'Success' diff --git a/tests/Connect-DbaInstance.Tests.ps1 b/tests/Connect-DbaInstance.Tests.ps1 index 9463cddf99..a9ddc64571 100644 --- a/tests/Connect-DbaInstance.Tests.ps1 +++ b/tests/Connect-DbaInstance.Tests.ps1 @@ -10,100 +10,100 @@ Describe "Connect-DbaInstance" { $CommandUnderTest = Get-Command Connect-DbaInstance } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ApplicationIntent as a parameter" { - $CommandUnderTest | Should -HaveParameter ApplicationIntent -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ApplicationIntent } It "Should have AzureUnsupported as a parameter" { - $CommandUnderTest | Should -HaveParameter AzureUnsupported -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AzureUnsupported } It "Should have BatchSeparator as a parameter" { - $CommandUnderTest | Should -HaveParameter BatchSeparator -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter BatchSeparator } It "Should have ClientName as a parameter" { - $CommandUnderTest | Should -HaveParameter ClientName -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ClientName } It "Should have ConnectTimeout as a parameter" { - $CommandUnderTest | Should -HaveParameter ConnectTimeout -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ConnectTimeout } It "Should have EncryptConnection as a parameter" { - $CommandUnderTest | Should -HaveParameter EncryptConnection -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EncryptConnection } It "Should have FailoverPartner as a parameter" { - $CommandUnderTest | Should -HaveParameter FailoverPartner -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FailoverPartner } It "Should have LockTimeout as a parameter" { - $CommandUnderTest | Should -HaveParameter LockTimeout -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LockTimeout } It "Should have MaxPoolSize as a parameter" { - $CommandUnderTest | Should -HaveParameter MaxPoolSize -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaxPoolSize } It "Should have MinPoolSize as a parameter" { - $CommandUnderTest | Should -HaveParameter MinPoolSize -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MinPoolSize } It "Should have MinimumVersion as a parameter" { - $CommandUnderTest | Should -HaveParameter MinimumVersion -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MinimumVersion } It "Should have MultipleActiveResultSets as a parameter" { - $CommandUnderTest | Should -HaveParameter MultipleActiveResultSets -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MultipleActiveResultSets } It "Should have MultiSubnetFailover as a parameter" { - $CommandUnderTest | Should -HaveParameter MultiSubnetFailover -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MultiSubnetFailover } It "Should have NetworkProtocol as a parameter" { - $CommandUnderTest | Should -HaveParameter NetworkProtocol -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NetworkProtocol } It "Should have NonPooledConnection as a parameter" { - $CommandUnderTest | Should -HaveParameter NonPooledConnection -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NonPooledConnection } It "Should have PacketSize as a parameter" { - $CommandUnderTest | Should -HaveParameter PacketSize -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PacketSize } It "Should have PooledConnectionLifetime as a parameter" { - $CommandUnderTest | Should -HaveParameter PooledConnectionLifetime -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PooledConnectionLifetime } It "Should have SqlExecutionModes as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlExecutionModes -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlExecutionModes } It "Should have StatementTimeout as a parameter" { - $CommandUnderTest | Should -HaveParameter StatementTimeout -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter StatementTimeout } It "Should have TrustServerCertificate as a parameter" { - $CommandUnderTest | Should -HaveParameter TrustServerCertificate -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter TrustServerCertificate } It "Should have WorkstationId as a parameter" { - $CommandUnderTest | Should -HaveParameter WorkstationId -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WorkstationId } It "Should have AlwaysEncrypted as a parameter" { - $CommandUnderTest | Should -HaveParameter AlwaysEncrypted -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AlwaysEncrypted } It "Should have AppendConnectionString as a parameter" { - $CommandUnderTest | Should -HaveParameter AppendConnectionString -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AppendConnectionString } It "Should have SqlConnectionOnly as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlConnectionOnly -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlConnectionOnly } It "Should have AzureDomain as a parameter" { - $CommandUnderTest | Should -HaveParameter AzureDomain -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AzureDomain } It "Should have Tenant as a parameter" { - $CommandUnderTest | Should -HaveParameter Tenant -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Tenant } It "Should have AccessToken as a parameter" { - $CommandUnderTest | Should -HaveParameter AccessToken -Type PSObject -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AccessToken } It "Should have DedicatedAdminConnection as a parameter" { - $CommandUnderTest | Should -HaveParameter DedicatedAdminConnection -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DedicatedAdminConnection } It "Should have DisableException as a parameter" { - $CommandUnderTest | Should -HaveParameter DisableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DisableException } } diff --git a/tests/Convert-DbaLsn.Tests.ps1 b/tests/Convert-DbaLsn.Tests.ps1 index a2a021b897..782b6a0b46 100644 --- a/tests/Convert-DbaLsn.Tests.ps1 +++ b/tests/Convert-DbaLsn.Tests.ps1 @@ -12,10 +12,10 @@ Describe "Convert-DbaLSN" { $CommandUnderTest = Get-Command Convert-DbaLSN } It "Should have LSN as a parameter" { - $CommandUnderTest | Should -HaveParameter LSN -Type System.String + $CommandUnderTest | Should -HaveParameter LSN } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Convert-DbaMaskingValue.Tests.ps1 b/tests/Convert-DbaMaskingValue.Tests.ps1 index 33f872b2b6..a1987fedd1 100644 --- a/tests/Convert-DbaMaskingValue.Tests.ps1 +++ b/tests/Convert-DbaMaskingValue.Tests.ps1 @@ -11,16 +11,16 @@ Describe "Convert-DbaMaskingValue" { $CommandUnderTest = Get-Command Convert-DbaMaskingValue } It "Should have Value as a parameter" { - $CommandUnderTest | Should -HaveParameter Value -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Value } It "Should have DataType as a parameter" { - $CommandUnderTest | Should -HaveParameter DataType -Type System.String + $CommandUnderTest | Should -HaveParameter DataType } It "Should have Nullable as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Nullable -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Nullable } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/ConvertTo-DbaDataTable.Tests.ps1 b/tests/ConvertTo-DbaDataTable.Tests.ps1 index 5b92fb2cc4..0c3683c5b8 100644 --- a/tests/ConvertTo-DbaDataTable.Tests.ps1 +++ b/tests/ConvertTo-DbaDataTable.Tests.ps1 @@ -10,22 +10,22 @@ Describe "ConvertTo-DbaDataTable" { $CommandUnderTest = Get-Command ConvertTo-DbaDataTable } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have TimeSpanType as a parameter" { - $CommandUnderTest | Should -HaveParameter TimeSpanType -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter TimeSpanType } It "Should have SizeType as a parameter" { - $CommandUnderTest | Should -HaveParameter SizeType -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SizeType } It "Should have IgnoreNull as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreNull -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IgnoreNull } It "Should have Raw as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Raw -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Raw } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/ConvertTo-DbaTimeline.Tests.ps1 b/tests/ConvertTo-DbaTimeline.Tests.ps1 index 11635d235c..f329a50477 100644 --- a/tests/ConvertTo-DbaTimeline.Tests.ps1 +++ b/tests/ConvertTo-DbaTimeline.Tests.ps1 @@ -12,13 +12,13 @@ Describe "ConvertTo-DbaTimeline" { $CommandUnderTest = Get-Command ConvertTo-DbaTimeline } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have ExcludeRowLabel as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeRowLabel -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeRowLabel } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/ConvertTo-DbaXESession.Tests.ps1 b/tests/ConvertTo-DbaXESession.Tests.ps1 index 4cfefc573b..5e69a7cd25 100644 --- a/tests/ConvertTo-DbaXESession.Tests.ps1 +++ b/tests/ConvertTo-DbaXESession.Tests.ps1 @@ -6,16 +6,16 @@ Describe "ConvertTo-DbaXESession" { $CommandUnderTest = Get-Command ConvertTo-DbaXESession } It "Accepts InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Accepts Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String + $CommandUnderTest | Should -HaveParameter Name } It "Accepts OutputScriptOnly as a parameter" { - $CommandUnderTest | Should -HaveParameter OutputScriptOnly -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter OutputScriptOnly } It "Accepts EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaAgentAlert.Tests.ps1 b/tests/Copy-DbaAgentAlert.Tests.ps1 index ea494d52c1..8e3d843b4d 100644 --- a/tests/Copy-DbaAgentAlert.Tests.ps1 +++ b/tests/Copy-DbaAgentAlert.Tests.ps1 @@ -6,31 +6,31 @@ Describe "Copy-DbaAgentAlert" { $CommandUnderTest = Get-Command Copy-DbaAgentAlert } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Alert as a parameter" { - $CommandUnderTest | Should -HaveParameter Alert -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Alert } It "Should have ExcludeAlert as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeAlert -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeAlert } It "Should have IncludeDefaults as a parameter" { - $CommandUnderTest | Should -HaveParameter IncludeDefaults -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeDefaults } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaAgentJob.Tests.ps1 b/tests/Copy-DbaAgentJob.Tests.ps1 index 5cdace2fb7..0a99e915a2 100644 --- a/tests/Copy-DbaAgentJob.Tests.ps1 +++ b/tests/Copy-DbaAgentJob.Tests.ps1 @@ -12,37 +12,37 @@ Describe "Copy-DbaAgentJob" { $CommandUnderTest = Get-Command Copy-DbaAgentJob } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type Microsoft.SqlServer.Management.Smo.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type Microsoft.SqlServer.Management.Smo.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Job as a parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Job } It "Should have ExcludeJob as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeJob -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeJob } It "Should have DisableOnSource as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DisableOnSource -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DisableOnSource } It "Should have DisableOnDestination as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DisableOnDestination -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DisableOnDestination } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Agent.Job[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaAgentJobCategory.Tests.ps1 b/tests/Copy-DbaAgentJobCategory.Tests.ps1 index 46aa9facbc..b7c15956b6 100644 --- a/tests/Copy-DbaAgentJobCategory.Tests.ps1 +++ b/tests/Copy-DbaAgentJobCategory.Tests.ps1 @@ -6,34 +6,34 @@ Describe "Copy-DbaAgentJobCategory" { $CommandUnderTest = Get-Command Copy-DbaAgentJobCategory } It "Should have Source parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have CategoryType parameter" { - $CommandUnderTest | Should -HaveParameter CategoryType -Type System.String[] + $CommandUnderTest | Should -HaveParameter CategoryType } It "Should have JobCategory parameter" { - $CommandUnderTest | Should -HaveParameter JobCategory -Type System.String[] + $CommandUnderTest | Should -HaveParameter JobCategory } It "Should have AgentCategory parameter" { - $CommandUnderTest | Should -HaveParameter AgentCategory -Type System.String[] + $CommandUnderTest | Should -HaveParameter AgentCategory } It "Should have OperatorCategory parameter" { - $CommandUnderTest | Should -HaveParameter OperatorCategory -Type System.String[] + $CommandUnderTest | Should -HaveParameter OperatorCategory } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Copy-DbaAgentOperator.Tests.ps1 b/tests/Copy-DbaAgentOperator.Tests.ps1 index 8276ebeb33..2aa1164ea1 100644 --- a/tests/Copy-DbaAgentOperator.Tests.ps1 +++ b/tests/Copy-DbaAgentOperator.Tests.ps1 @@ -29,28 +29,28 @@ Describe "Copy-DbaAgentOperator" { $CommandUnderTest = Get-Command Copy-DbaAgentOperator } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Operator as a parameter" { - $CommandUnderTest | Should -HaveParameter Operator -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Operator } It "Should have ExcludeOperator as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeOperator -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeOperator } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaAgentProxy.Tests.ps1 b/tests/Copy-DbaAgentProxy.Tests.ps1 index 7a1c4e8955..19ca0eb9be 100644 --- a/tests/Copy-DbaAgentProxy.Tests.ps1 +++ b/tests/Copy-DbaAgentProxy.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Copy-DbaAgentProxy" { $CommandUnderTest = Get-Command Copy-DbaAgentProxy } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have ProxyAccount as a parameter" { - $CommandUnderTest | Should -HaveParameter ProxyAccount -Type System.String[] + $CommandUnderTest | Should -HaveParameter ProxyAccount } It "Should have ExcludeProxyAccount as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeProxyAccount -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeProxyAccount } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Copy-DbaAgentSchedule.Tests.ps1 b/tests/Copy-DbaAgentSchedule.Tests.ps1 index fdba6ba25d..e1c1f5de59 100644 --- a/tests/Copy-DbaAgentSchedule.Tests.ps1 +++ b/tests/Copy-DbaAgentSchedule.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Copy-DbaAgentSchedule" { $CommandUnderTest = Get-Command Copy-DbaAgentSchedule } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Schedule as a parameter" { - $CommandUnderTest | Should -HaveParameter Schedule -Type System.String[] + $CommandUnderTest | Should -HaveParameter Schedule } It "Should have Id as a parameter" { - $CommandUnderTest | Should -HaveParameter Id -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter Id } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Agent.JobSchedule[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaAgentServer.Tests.ps1 b/tests/Copy-DbaAgentServer.Tests.ps1 index fc62aee260..68425d759b 100644 --- a/tests/Copy-DbaAgentServer.Tests.ps1 +++ b/tests/Copy-DbaAgentServer.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Copy-DbaAgentServer" { $CommandUnderTest = Get-Command Copy-DbaAgentServer } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have DisableJobsOnDestination as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DisableJobsOnDestination -Type switch + $CommandUnderTest | Should -HaveParameter DisableJobsOnDestination } It "Should have DisableJobsOnSource as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DisableJobsOnSource -Type switch + $CommandUnderTest | Should -HaveParameter DisableJobsOnSource } It "Should have ExcludeServerProperties as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeServerProperties -Type switch + $CommandUnderTest | Should -HaveParameter ExcludeServerProperties } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type switch + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Copy-DbaBackupDevice.Tests.ps1 b/tests/Copy-DbaBackupDevice.Tests.ps1 index 59a560aa56..22730e5eaf 100644 --- a/tests/Copy-DbaBackupDevice.Tests.ps1 +++ b/tests/Copy-DbaBackupDevice.Tests.ps1 @@ -12,25 +12,25 @@ Describe "Copy-DbaBackupDevice" { $CommandUnderTest = Get-Command Copy-DbaBackupDevice } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have BackupDevice as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupDevice -Type System.Object[] + $CommandUnderTest | Should -HaveParameter BackupDevice } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaCredential.Tests.ps1 b/tests/Copy-DbaCredential.Tests.ps1 index c381c50516..1232c9d32f 100644 --- a/tests/Copy-DbaCredential.Tests.ps1 +++ b/tests/Copy-DbaCredential.Tests.ps1 @@ -42,37 +42,37 @@ Describe "Copy-DbaCredential" { $CommandUnderTest = Get-Command Copy-DbaCredential } It "Should have Source parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Credential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Destination parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Name parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] + $CommandUnderTest | Should -HaveParameter Name } It "Should have ExcludeName parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeName -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeName } It "Should have Identity parameter" { - $CommandUnderTest | Should -HaveParameter Identity -Type System.String[] + $CommandUnderTest | Should -HaveParameter Identity } It "Should have ExcludeIdentity parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeIdentity -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeIdentity } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaCustomError.Tests.ps1 b/tests/Copy-DbaCustomError.Tests.ps1 index ce3715fb62..48cbb17f8c 100644 --- a/tests/Copy-DbaCustomError.Tests.ps1 +++ b/tests/Copy-DbaCustomError.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Copy-DbaCustomError" { $CommandUnderTest = Get-Command Copy-DbaCustomError } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have CustomError as a parameter" { - $CommandUnderTest | Should -HaveParameter CustomError -Type System.Object[] + $CommandUnderTest | Should -HaveParameter CustomError } It "Should have ExcludeCustomError as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeCustomError -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeCustomError } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaDataCollector.Tests.ps1 b/tests/Copy-DbaDataCollector.Tests.ps1 index 1d63466fed..62d0aaa6ed 100644 --- a/tests/Copy-DbaDataCollector.Tests.ps1 +++ b/tests/Copy-DbaDataCollector.Tests.ps1 @@ -6,31 +6,31 @@ Describe "Copy-DbaDataCollector" { $CommandUnderTest = Get-Command Copy-DbaDataCollector } It "Should have Source parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have CollectionSet parameter" { - $CommandUnderTest | Should -HaveParameter CollectionSet -Type System.Object[] + $CommandUnderTest | Should -HaveParameter CollectionSet } It "Should have ExcludeCollectionSet parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeCollectionSet -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeCollectionSet } It "Should have NoServerReconfig parameter" { - $CommandUnderTest | Should -HaveParameter NoServerReconfig -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoServerReconfig } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Copy-DbaDatabase.Tests.ps1 b/tests/Copy-DbaDatabase.Tests.ps1 index bdd0cdd0a7..df5a22387a 100644 --- a/tests/Copy-DbaDatabase.Tests.ps1 +++ b/tests/Copy-DbaDatabase.Tests.ps1 @@ -71,24 +71,20 @@ Describe "Copy-DbaDatabase" { $params | Should -Contain 'KeepReplication' } - It "Source should be a Dataplat.Dbatools.Parameter.DbaInstanceParameter and not mandatory" { + It "Source should be a Dataplat.Dbatools.Parameter.DbaInstanceParameter" { (Get-Command Copy-DbaDatabase).Parameters['Source'].ParameterType.FullName | Should -Be 'Dataplat.Dbatools.Parameter.DbaInstanceParameter' - (Get-Command Copy-DbaDatabase).Parameters['Source'].Attributes.Mandatory | Should -Be $false } - It "SourceSqlCredential should be a System.Management.Automation.PSCredential and not mandatory" { + It "SourceSqlCredential should be a System.Management.Automation.PSCredential" { (Get-Command Copy-DbaDatabase).Parameters['SourceSqlCredential'].ParameterType.FullName | Should -Be 'System.Management.Automation.PSCredential' - (Get-Command Copy-DbaDatabase).Parameters['SourceSqlCredential'].Attributes.Mandatory | Should -Be $false } - It "Destination should be a Dataplat.Dbatools.Parameter.DbaInstanceParameter[] and not mandatory" { + It "Destination should be a Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { (Get-Command Copy-DbaDatabase).Parameters['Destination'].ParameterType.FullName | Should -Be 'Dataplat.Dbatools.Parameter.DbaInstanceParameter[]' - (Get-Command Copy-DbaDatabase).Parameters['Destination'].Attributes.Mandatory | Should -Be $false } - It "DestinationSqlCredential should be a System.Management.Automation.PSCredential and not mandatory" { + It "DestinationSqlCredential should be a System.Management.Automation.PSCredential" { (Get-Command Copy-DbaDatabase).Parameters['DestinationSqlCredential'].ParameterType.FullName | Should -Be 'System.Management.Automation.PSCredential' - (Get-Command Copy-DbaDatabase).Parameters['DestinationSqlCredential'].Attributes.Mandatory | Should -Be $false } # Add similar tests for other parameters... diff --git a/tests/Copy-DbaDbAssembly.Tests.ps1 b/tests/Copy-DbaDbAssembly.Tests.ps1 index 83efd527fb..08503c6255 100644 --- a/tests/Copy-DbaDbAssembly.Tests.ps1 +++ b/tests/Copy-DbaDbAssembly.Tests.ps1 @@ -7,28 +7,28 @@ Describe "Copy-DbaDbAssembly Unit Tests" -Tag 'UnitTests' { $Command = Get-Command -Name $CommandName } It "Should have Source parameter" { - $Command | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter -Mandatory:$false + $Command | Should -HaveParameter Source } It "Should have SourceSqlCredential parameter" { - $Command | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $Command | Should -HaveParameter SourceSqlCredential } It "Should have Destination parameter" { - $Command | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $Command | Should -HaveParameter Destination } It "Should have DestinationSqlCredential parameter" { - $Command | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $Command | Should -HaveParameter DestinationSqlCredential } It "Should have Assembly parameter" { - $Command | Should -HaveParameter Assembly -Type System.Object[] -Mandatory:$false + $Command | Should -HaveParameter Assembly } It "Should have ExcludeAssembly parameter" { - $Command | Should -HaveParameter ExcludeAssembly -Type System.Object[] -Mandatory:$false + $Command | Should -HaveParameter ExcludeAssembly } It "Should have Force parameter" { - $Command | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $Command | Should -HaveParameter Force } It "Should have EnableException parameter" { - $Command | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $Command | Should -HaveParameter EnableException } } } @@ -46,4 +46,4 @@ Describe "Copy-DbaDbAssembly Integration Tests" -Tag "IntegrationTests" { $server2.Query("RECONFIGURE") $instance2DB = Get-DbaDatabase -SqlInstance $global:instance2 -Database dbclrassembly - $instance2DB.Query("CREATE ASSEMBLY [resolveDNS] AUTHORIZATION [dbo] FROM 0x4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000000000000000000000000000000000000000000000000000000800000000E1FBA0E00B409CD21B8014CCD21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652E0D0D0A2400000000000000504500004C010300457830570000000000000000E00002210B010B000008000000060000000000002E260000002000000040000000000010002000000002000004000000000000000400000000000000008000000002000000000000030040850000100000100000000010000010000000000000100000000000000000000000E02500004B00000000400000B002000000000000000000000000000000000000006000000C000000A82400001C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000080000000000000000000000082000004800000000000000000000002E7465787400000034060000002000000008000000020000000000000000000000000000200000602E72737263000000B00200000040000000040000000A0000000000000000000000000000400000402E72656C6F6300000C0000000060000000020000000E0000000000000000000000000000400000420000000000000000000000000000000010260000000000004800000002000500A42000000404000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001B3001002F000000010000110000026F0500000A280600000A6F0700000A6F0800000A0A06730900000A0BDE0B260002730900000A0BDE0000072A0001100000000001002021000B010000011E02280A00000A2A42534A4201000100000000000C00000076322E302E35303732370000000005006C00000070010000237E0000DC010000A401000023537472696E67730000000080030000080000002355530088030000100000002347554944000000980300006C00000023426C6F620000000000000002000001471502000900000000FA253300160000010000000A0000000200000002000000010000000A0000000400000001000000010000000300000000000A0001000000000006003E0037000A006600510006009D008A000F00B10000000600E000C00006000001C0000A00440129010600590137000E00700165010E007401650100000000010000000000010001000100100019000000050001000100502000000000960070000A0001009C200000000086187D001000020000000100830019007D00140029007D001A0031007D00100039007D00100041006001240049008001280051008D01240009009A01240011007D002E0009007D001000200023001F002E000B0039002E00130042002E001B004B0033000480000000000000000000000000000000001E01000002000000000000000000000001002E00000000000200000000000000000000000000100450000000000020000000000000000000000010037000000000000000000003C4D6F64756C653E007265736F6C7665444E532E646C6C0055736572446566696E656446756E6374696F6E73006D73636F726C69620053797374656D004F626A6563740053797374656D2E446174610053797374656D2E446174612E53716C54797065730053716C537472696E67004950746F486F73744E616D65002E63746F72006970616464720053797374656D2E446961676E6F73746963730044656275676761626C6541747472696275746500446562756767696E674D6F6465730053797374656D2E52756E74696D652E436F6D70696C6572536572766963657300436F6D70696C6174696F6E52656C61786174696F6E734174747269627574650052756E74696D65436F6D7061746962696C697479417474726962757465007265736F6C7665444E53004D6963726F736F66742E53716C5365727665722E5365727665720053716C46756E6374696F6E41747472696275746500537472696E67005472696D0053797374656D2E4E657400446E73004950486F7374456E74727900476574486F7374456E747279006765745F486F73744E616D6500546F537472696E6700000003200000000000BBBB2D2F51E12E4791398BFA79459ABA0008B77A5C561934E08905000111090E03200001052001011111042001010804010000000320000E05000112290E042001010E0507020E11090801000701000000000801000800000000001E01000100540216577261704E6F6E457863657074696F6E5468726F7773010000000000004578305700000000020000001C010000C4240000C40600005253445357549849C5462E43AD588F97CA53634201000000633A5C74656D705C4461746162617365315C4461746162617365315C6F626A5C44656275675C7265736F6C7665444E532E706462000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 \ No newline at end of file + $instance2DB.Query("CREATE ASSEMBLY [resolveDNS] AUTHORIZATION [dbo] FROM 0x4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000000000000000000000000000000000000000000000000000000800000000E1FBA0E00B409CD21B8014CCD21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652E0D0D0A2400000000000000504500004C010300457830570000000000000000E00002210B010B000008000000060000000000002E260000002000000040000000000010002000000002000004000000000000000400000000000000008000000002000000000000030040850000100000100000000010000010000000000000100000000000000000000000E02500004B00000000400000B002000000000000000000000000000000000000006000000C000000A82400001C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000080000000000000000000000082000004800000000000000000000002E7465787400000034060000002000000008000000020000000000000000000000000000200000602E72737263000000B00200000040000000040000000A0000000000000000000000000000400000402E72656C6F6300000C0000000060000000020000000E0000000000000000000000000000400000420000000000000000000000000000000010260000000000004800000002000500A42000000404000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001B3001002F000000010000110000026F0500000A280600000A6F0700000A6F0800000A0A06730900000A0BDE0B260002730900000A0BDE0000072A0001100000000001002021000B010000011E02280A00000A2A42534A4201000100000000000C00000076322E302E35303732370000000005006C00000070010000237E0000DC010000A401000023537472696E67730000000080030000080000002355530088030000100000002347554944000000980300006C00000023426C6F620000000000000002000001471502000900000000FA253300160000010000000A0000000200000002000000010000000A0000000400000001000000010000000300000000000A0001000000000006003E0037000A006600510006009D008A000F00B10000000600E000C00006000001C0000A00440129010600590137000E00700165010E007401650100000000010000000000010001000100100019000000050001000100502000000000960070000A0001009C200000000086187D001000020000000100830019007D00140029007D001A0031007D00100039007D00100041006001240049008001280051008D01240009009A01240011007D002E0009007D001000200023001F002E000B0039002E00130042002E001B004B0033000480000000000000000000000000000000001E01000002000000000000000000000001002E00000000000200000000000000000000000000100450000000000020000000000000000000000010037000000000000000000003C4D6F64756C653E007265736F6C7665444E532E646C6C0055736572446566696E656446756E6374696F6E73006D73636F726C69620053797374656D004F626A6563740053797374656D2E446174610053797374656D2E446174612E53716C54797065730053716C537472696E67004950746F486F73744E616D65002E63746F72006970616464720053797374656D2E446961676E6F73746963730044656275676761626C6541747472696275746500446562756767696E674D6F6465730053797374656D2E52756E74696D652E436F6D70696C6572536572766963657300436F6D70696C6174696F6E52656C61786174696F6E734174747269627574650052756E74696D65436F6D7061746962696C697479417474726962757465007265736F6C7665444E53004D6963726F736F66742E53716C5365727665722E5365727665720053716C46756E6374696F6E41747472696275746500537472696E67005472696D0053797374656D2E4E657400446E73004950486F7374456E74727900476574486F7374456E747279006765745F486F73744E616D6500546F537472696E6700000003200000000000BBBB2D2F51E12E4791398BFA79459ABA0008B77A5C561934E08905000111090E03200001052001011111042001010804010000000320000E05000112290E042001010E0507020E11090801000701000000000801000800000000001E01000100540216577261704E6F6E457863657074696F6E5468726F7773010000000000004578305700000000020000001C010000C4240000C40600005253445357549849C5462E43AD588F97CA53634201000000633A5C74656D705C4461746162617365315C4461746162617365315C6F626A5C44656275675C7265736F6C7665444E532E70646200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 \ No newline at end of file diff --git a/tests/Copy-DbaDbCertificate.Tests.ps1 b/tests/Copy-DbaDbCertificate.Tests.ps1 index ccfb2e2fca..006981300f 100644 --- a/tests/Copy-DbaDbCertificate.Tests.ps1 +++ b/tests/Copy-DbaDbCertificate.Tests.ps1 @@ -6,43 +6,43 @@ Describe "Copy-DbaDbCertificate" { $CommandUnderTest = Get-Command Copy-DbaDbCertificate } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Certificate as a parameter" { - $CommandUnderTest | Should -HaveParameter Certificate -Type System.String[] + $CommandUnderTest | Should -HaveParameter Certificate } It "Should have ExcludeCertificate as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeCertificate -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeCertificate } It "Should have SharedPath as a parameter" { - $CommandUnderTest | Should -HaveParameter SharedPath -Type System.String + $CommandUnderTest | Should -HaveParameter SharedPath } It "Should have MasterKeyPassword as a parameter" { - $CommandUnderTest | Should -HaveParameter MasterKeyPassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter MasterKeyPassword } It "Should have EncryptionPassword as a parameter" { - $CommandUnderTest | Should -HaveParameter EncryptionPassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter EncryptionPassword } It "Should have DecryptionPassword as a parameter" { - $CommandUnderTest | Should -HaveParameter DecryptionPassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter DecryptionPassword } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Copy-DbaDbMail.Tests.ps1 b/tests/Copy-DbaDbMail.Tests.ps1 index 25198217f5..ca53eec734 100644 --- a/tests/Copy-DbaDbMail.Tests.ps1 +++ b/tests/Copy-DbaDbMail.Tests.ps1 @@ -61,25 +61,25 @@ Describe "Copy-DbaDbMail" { $CommandUnderTest = Get-Command Copy-DbaDbMail } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] + $CommandUnderTest | Should -HaveParameter Type } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaDbQueryStoreOption.Tests.ps1 b/tests/Copy-DbaDbQueryStoreOption.Tests.ps1 index e897148a39..d298a3b9ac 100644 --- a/tests/Copy-DbaDbQueryStoreOption.Tests.ps1 +++ b/tests/Copy-DbaDbQueryStoreOption.Tests.ps1 @@ -6,31 +6,31 @@ Describe "Copy-DbaDbQueryStoreOption" { $CommandUnderTest = Get-Command Copy-DbaDbQueryStoreOption } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have SourceDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceDatabase -Type System.Object + $CommandUnderTest | Should -HaveParameter SourceDatabase } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have DestinationDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter DestinationDatabase } It "Should have Exclude as a parameter" { - $CommandUnderTest | Should -HaveParameter Exclude -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Exclude } It "Should have AllDatabases as a parameter" { - $CommandUnderTest | Should -HaveParameter AllDatabases -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AllDatabases } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Copy-DbaDbTableData.Tests.ps1 b/tests/Copy-DbaDbTableData.Tests.ps1 index baca8278d1..3f10f0d5bb 100644 --- a/tests/Copy-DbaDbTableData.Tests.ps1 +++ b/tests/Copy-DbaDbTableData.Tests.ps1 @@ -46,76 +46,76 @@ Describe "Copy-DbaDbTableData" { $CommandUnderTest = Get-Command Copy-DbaDbTableData } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type Microsoft.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have DestinationDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationDatabase -Type System.String + $CommandUnderTest | Should -HaveParameter DestinationDatabase } It "Should have Table as a parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] + $CommandUnderTest | Should -HaveParameter Table } It "Should have View as a parameter" { - $CommandUnderTest | Should -HaveParameter View -Type System.String[] + $CommandUnderTest | Should -HaveParameter View } It "Should have Query as a parameter" { - $CommandUnderTest | Should -HaveParameter Query -Type System.String + $CommandUnderTest | Should -HaveParameter Query } It "Should have AutoCreateTable as a switch parameter" { - $CommandUnderTest | Should -HaveParameter AutoCreateTable -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AutoCreateTable } It "Should have BatchSize as a parameter" { - $CommandUnderTest | Should -HaveParameter BatchSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BatchSize } It "Should have NotifyAfter as a parameter" { - $CommandUnderTest | Should -HaveParameter NotifyAfter -Type System.Int32 + $CommandUnderTest | Should -HaveParameter NotifyAfter } It "Should have DestinationTable as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationTable -Type System.String + $CommandUnderTest | Should -HaveParameter DestinationTable } It "Should have NoTableLock as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoTableLock -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoTableLock } It "Should have CheckConstraints as a switch parameter" { - $CommandUnderTest | Should -HaveParameter CheckConstraints -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter CheckConstraints } It "Should have FireTriggers as a switch parameter" { - $CommandUnderTest | Should -HaveParameter FireTriggers -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter FireTriggers } It "Should have KeepIdentity as a switch parameter" { - $CommandUnderTest | Should -HaveParameter KeepIdentity -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter KeepIdentity } It "Should have KeepNulls as a switch parameter" { - $CommandUnderTest | Should -HaveParameter KeepNulls -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter KeepNulls } It "Should have Truncate as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Truncate -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Truncate } It "Should have BulkCopyTimeout as a parameter" { - $CommandUnderTest | Should -HaveParameter BulkCopyTimeout -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BulkCopyTimeout } It "Should have CommandTimeout as a parameter" { - $CommandUnderTest | Should -HaveParameter CommandTimeout -Type System.Int32 + $CommandUnderTest | Should -HaveParameter CommandTimeout } It "Should have UseDefaultFileGroup as a switch parameter" { - $CommandUnderTest | Should -HaveParameter UseDefaultFileGroup -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter UseDefaultFileGroup } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.TableViewBase[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaDbViewData.Tests.ps1 b/tests/Copy-DbaDbViewData.Tests.ps1 index 3e67d23d8c..72d5bde6ae 100644 --- a/tests/Copy-DbaDbViewData.Tests.ps1 +++ b/tests/Copy-DbaDbViewData.Tests.ps1 @@ -67,67 +67,67 @@ Describe "Copy-DbaDbViewData" { $CommandUnderTest = Get-Command Copy-DbaDbViewData } It "Should have SqlInstance as a Dataplat.Dbatools.Parameter.DbaInstanceParameter parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a System.Management.Automation.PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Destination as a Dataplat.Dbatools.Parameter.DbaInstanceParameter[] parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a System.Management.Automation.PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Database as a System.String parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have DestinationDatabase as a System.String parameter" { - $CommandUnderTest | Should -HaveParameter DestinationDatabase -Type System.String + $CommandUnderTest | Should -HaveParameter DestinationDatabase } It "Should have View as a System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter View -Type System.String[] + $CommandUnderTest | Should -HaveParameter View } It "Should have Query as a System.String parameter" { - $CommandUnderTest | Should -HaveParameter Query -Type System.String + $CommandUnderTest | Should -HaveParameter Query } It "Should have AutoCreateTable as a System.Management.Automation.SwitchParameter parameter" { - $CommandUnderTest | Should -HaveParameter AutoCreateTable -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AutoCreateTable } It "Should have BatchSize as a System.Int32 parameter" { - $CommandUnderTest | Should -HaveParameter BatchSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BatchSize } It "Should have NotifyAfter as a System.Int32 parameter" { - $CommandUnderTest | Should -HaveParameter NotifyAfter -Type System.Int32 + $CommandUnderTest | Should -HaveParameter NotifyAfter } It "Should have DestinationTable as a System.String parameter" { - $CommandUnderTest | Should -HaveParameter DestinationTable -Type System.String + $CommandUnderTest | Should -HaveParameter DestinationTable } It "Should have NoTableLock as a System.Management.Automation.SwitchParameter parameter" { - $CommandUnderTest | Should -HaveParameter NoTableLock -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoTableLock } It "Should have CheckConstraints as a System.Management.Automation.SwitchParameter parameter" { - $CommandUnderTest | Should -HaveParameter CheckConstraints -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter CheckConstraints } It "Should have FireTriggers as a System.Management.Automation.SwitchParameter parameter" { - $CommandUnderTest | Should -HaveParameter FireTriggers -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter FireTriggers } It "Should have KeepIdentity as a System.Management.Automation.SwitchParameter parameter" { - $CommandUnderTest | Should -HaveParameter KeepIdentity -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter KeepIdentity } It "Should have KeepNulls as a System.Management.Automation.SwitchParameter parameter" { - $CommandUnderTest | Should -HaveParameter KeepNulls -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter KeepNulls } It "Should have Truncate as a System.Management.Automation.SwitchParameter parameter" { - $CommandUnderTest | Should -HaveParameter Truncate -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Truncate } It "Should have BulkCopyTimeOut as a System.Int32 parameter" { - $CommandUnderTest | Should -HaveParameter BulkCopyTimeOut -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BulkCopyTimeOut } It "Should have InputObject as a Microsoft.SqlServer.Management.Smo.TableViewBase[] parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.TableViewBase[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a System.Management.Automation.SwitchParameter parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaEndpoint.Tests.ps1 b/tests/Copy-DbaEndpoint.Tests.ps1 index dba7fdfa16..ab3dfc68ac 100644 --- a/tests/Copy-DbaEndpoint.Tests.ps1 +++ b/tests/Copy-DbaEndpoint.Tests.ps1 @@ -12,28 +12,28 @@ Describe "Copy-DbaEndpoint" { $CommandUnderTest = Get-Command Copy-DbaEndpoint } It "Should have Source parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Endpoint parameter" { - $CommandUnderTest | Should -HaveParameter Endpoint -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Endpoint } It "Should have ExcludeEndpoint parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeEndpoint -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeEndpoint } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Copy-DbaInstanceAudit.Tests.ps1 b/tests/Copy-DbaInstanceAudit.Tests.ps1 index aabbc39a46..43431867c8 100644 --- a/tests/Copy-DbaInstanceAudit.Tests.ps1 +++ b/tests/Copy-DbaInstanceAudit.Tests.ps1 @@ -6,31 +6,31 @@ Describe "Copy-DbaInstanceAudit" { $CommandUnderTest = Get-Command Copy-DbaInstanceAudit } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Audit as a parameter" { - $CommandUnderTest | Should -HaveParameter Audit -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Audit } It "Should have ExcludeAudit as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeAudit -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeAudit } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Copy-DbaInstanceAuditSpecification.Tests.ps1 b/tests/Copy-DbaInstanceAuditSpecification.Tests.ps1 index 703944806e..36f3fbff75 100644 --- a/tests/Copy-DbaInstanceAuditSpecification.Tests.ps1 +++ b/tests/Copy-DbaInstanceAuditSpecification.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Copy-DbaInstanceAuditSpecification" { $CommandUnderTest = Get-Command Copy-DbaInstanceAuditSpecification } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have AuditSpecification as a parameter" { - $CommandUnderTest | Should -HaveParameter AuditSpecification -Type System.Object[] + $CommandUnderTest | Should -HaveParameter AuditSpecification } It "Should have ExcludeAuditSpecification as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeAuditSpecification -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeAuditSpecification } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaInstanceTrigger.Tests.ps1 b/tests/Copy-DbaInstanceTrigger.Tests.ps1 index 2e2f820670..e45c4ec1fc 100644 --- a/tests/Copy-DbaInstanceTrigger.Tests.ps1 +++ b/tests/Copy-DbaInstanceTrigger.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Copy-DbaInstanceTrigger" { $CommandUnderTest = Get-Command Copy-DbaInstanceTrigger } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have ServerTrigger as a parameter" { - $CommandUnderTest | Should -HaveParameter ServerTrigger -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ServerTrigger } It "Should have ExcludeServerTrigger as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeServerTrigger -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeServerTrigger } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaLinkedServer.Tests.ps1 b/tests/Copy-DbaLinkedServer.Tests.ps1 index 0f7baec665..f0ecf3150d 100644 --- a/tests/Copy-DbaLinkedServer.Tests.ps1 +++ b/tests/Copy-DbaLinkedServer.Tests.ps1 @@ -31,34 +31,34 @@ Describe "Copy-DbaLinkedServer" { $CommandUnderTest = Get-Command Copy-DbaLinkedServer } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have LinkedServer as a parameter" { - $CommandUnderTest | Should -HaveParameter LinkedServer -Type System.Object[] + $CommandUnderTest | Should -HaveParameter LinkedServer } It "Should have ExcludeLinkedServer as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeLinkedServer -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeLinkedServer } It "Should have UpgradeSqlClient as a switch parameter" { - $CommandUnderTest | Should -HaveParameter UpgradeSqlClient -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter UpgradeSqlClient } It "Should have ExcludePassword as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludePassword -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludePassword } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaLogin.Tests.ps1 b/tests/Copy-DbaLogin.Tests.ps1 index 02c41b99de..2abc758699 100644 --- a/tests/Copy-DbaLogin.Tests.ps1 +++ b/tests/Copy-DbaLogin.Tests.ps1 @@ -60,55 +60,55 @@ Describe "Copy-DbaLogin" { $CommandUnderTest = Get-Command Copy-DbaLogin } It "Should have Source parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Login parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Login } It "Should have ExcludeLogin parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeLogin -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeLogin } It "Should have ExcludeSystemLogins parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemLogins -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeSystemLogins } It "Should have SyncSaName parameter" { - $CommandUnderTest | Should -HaveParameter SyncSaName -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter SyncSaName } It "Should have OutFile parameter" { - $CommandUnderTest | Should -HaveParameter OutFile -Type System.String + $CommandUnderTest | Should -HaveParameter OutFile } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have LoginRenameHashtable parameter" { - $CommandUnderTest | Should -HaveParameter LoginRenameHashtable -Type System.Collections.Hashtable + $CommandUnderTest | Should -HaveParameter LoginRenameHashtable } It "Should have KillActiveConnection parameter" { - $CommandUnderTest | Should -HaveParameter KillActiveConnection -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter KillActiveConnection } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have ExcludePermissionSync parameter" { - $CommandUnderTest | Should -HaveParameter ExcludePermissionSync -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludePermissionSync } It "Should have NewSid parameter" { - $CommandUnderTest | Should -HaveParameter NewSid -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NewSid } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have ObjectLevel parameter" { - $CommandUnderTest | Should -HaveParameter ObjectLevel -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ObjectLevel } } diff --git a/tests/Copy-DbaPolicyManagement.Tests.ps1 b/tests/Copy-DbaPolicyManagement.Tests.ps1 index 7916cdbaf7..99fb2e774c 100644 --- a/tests/Copy-DbaPolicyManagement.Tests.ps1 +++ b/tests/Copy-DbaPolicyManagement.Tests.ps1 @@ -6,34 +6,34 @@ Describe "Copy-DbaPolicyManagement" { $CommandUnderTest = Get-Command Copy-DbaPolicyManagement } It "Should have Source parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Policy parameter" { - $CommandUnderTest | Should -HaveParameter Policy -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Policy } It "Should have ExcludePolicy parameter" { - $CommandUnderTest | Should -HaveParameter ExcludePolicy -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludePolicy } It "Should have Condition parameter" { - $CommandUnderTest | Should -HaveParameter Condition -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Condition } It "Should have ExcludeCondition parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeCondition -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeCondition } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Copy-DbaRegServer.Tests.ps1 b/tests/Copy-DbaRegServer.Tests.ps1 index 4bd823ffda..0011e875a1 100644 --- a/tests/Copy-DbaRegServer.Tests.ps1 +++ b/tests/Copy-DbaRegServer.Tests.ps1 @@ -10,28 +10,28 @@ Describe "Copy-DbaRegServer" { $CommandUnderTest = Get-Command Copy-DbaRegServer } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Group as a parameter" { - $CommandUnderTest | Should -HaveParameter Group -Type System.String[] + $CommandUnderTest | Should -HaveParameter Group } It "Should have SwitchServerName as a switch parameter" { - $CommandUnderTest | Should -HaveParameter SwitchServerName -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter SwitchServerName } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaResourceGovernor.Tests.ps1 b/tests/Copy-DbaResourceGovernor.Tests.ps1 index e7fd7c1d45..1e7cf98671 100644 --- a/tests/Copy-DbaResourceGovernor.Tests.ps1 +++ b/tests/Copy-DbaResourceGovernor.Tests.ps1 @@ -66,28 +66,28 @@ ALTER RESOURCE GOVERNOR RECONFIGURE; $CommandUnderTest = Get-Command Copy-DbaResourceGovernor } It "Should have Source parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have ResourcePool parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePool -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ResourcePool } It "Should have ExcludeResourcePool parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeResourcePool -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeResourcePool } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaSpConfigure.Tests.ps1 b/tests/Copy-DbaSpConfigure.Tests.ps1 index ed66873211..e18791a91b 100644 --- a/tests/Copy-DbaSpConfigure.Tests.ps1 +++ b/tests/Copy-DbaSpConfigure.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Copy-DbaSpConfigure" { $CommandUnderTest = Get-Command Copy-DbaSpConfigure } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have ConfigName as a parameter" { - $CommandUnderTest | Should -HaveParameter ConfigName -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ConfigName } It "Should have ExcludeConfigName as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeConfigName -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeConfigName } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Copy-DbaSsisCatalog.Tests.ps1 b/tests/Copy-DbaSsisCatalog.Tests.ps1 index bb7eaf5288..ea61739eaf 100644 --- a/tests/Copy-DbaSsisCatalog.Tests.ps1 +++ b/tests/Copy-DbaSsisCatalog.Tests.ps1 @@ -12,37 +12,37 @@ Describe "Copy-DbaSsisCatalog" { $CommandUnderTest = Get-Command Copy-DbaSsisCatalog } It "Should have Source parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have Destination parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have SourceSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have DestinationSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Project parameter" { - $CommandUnderTest | Should -HaveParameter Project -Type System.String + $CommandUnderTest | Should -HaveParameter Project } It "Should have Folder parameter" { - $CommandUnderTest | Should -HaveParameter Folder -Type System.String + $CommandUnderTest | Should -HaveParameter Folder } It "Should have Environment parameter" { - $CommandUnderTest | Should -HaveParameter Environment -Type System.String + $CommandUnderTest | Should -HaveParameter Environment } It "Should have CreateCatalogPassword parameter" { - $CommandUnderTest | Should -HaveParameter CreateCatalogPassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter CreateCatalogPassword } It "Should have EnableSqlClr parameter" { - $CommandUnderTest | Should -HaveParameter EnableSqlClr -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableSqlClr } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Copy-DbaStartupProcedure.Tests.ps1 b/tests/Copy-DbaStartupProcedure.Tests.ps1 index e5f78a5490..90538aa3b0 100644 --- a/tests/Copy-DbaStartupProcedure.Tests.ps1 +++ b/tests/Copy-DbaStartupProcedure.Tests.ps1 @@ -26,28 +26,28 @@ Describe "Copy-DbaStartupProcedure" { $CommandUnderTest = Get-Command Copy-DbaStartupProcedure } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Procedure as a parameter" { - $CommandUnderTest | Should -HaveParameter Procedure -Type System.String[] + $CommandUnderTest | Should -HaveParameter Procedure } It "Should have ExcludeProcedure as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeProcedure -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeProcedure } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaSystemDbUserObject.Tests.ps1 b/tests/Copy-DbaSystemDbUserObject.Tests.ps1 index 313d8cb90f..c4cade4298 100644 --- a/tests/Copy-DbaSystemDbUserObject.Tests.ps1 +++ b/tests/Copy-DbaSystemDbUserObject.Tests.ps1 @@ -63,25 +63,25 @@ AS $CommandUnderTest = Get-Command Copy-DbaSystemDbUserObject } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have Classic as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Classic -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Classic } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaXESession.Tests.ps1 b/tests/Copy-DbaXESession.Tests.ps1 index fb14fccf84..6a209d5fcf 100644 --- a/tests/Copy-DbaXESession.Tests.ps1 +++ b/tests/Copy-DbaXESession.Tests.ps1 @@ -10,28 +10,28 @@ Describe "Copy-DbaXESession" { $CommandUnderTest = Get-Command Copy-DbaXESession } It "Should have Source parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have Destination parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have SourceSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have DestinationSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have XeSession parameter" { - $CommandUnderTest | Should -HaveParameter XeSession -Type System.Object[] + $CommandUnderTest | Should -HaveParameter XeSession } It "Should have ExcludeXeSession parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeXeSession -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeXeSession } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Copy-DbaXESessionTemplate.Tests.ps1 b/tests/Copy-DbaXESessionTemplate.Tests.ps1 index 79c8858938..e06e186977 100644 --- a/tests/Copy-DbaXESessionTemplate.Tests.ps1 +++ b/tests/Copy-DbaXESessionTemplate.Tests.ps1 @@ -5,14 +5,14 @@ Describe "Copy-DbaXESessionTemplate" { BeforeAll { $CommandUnderTest = Get-Command Copy-DbaXESessionTemplate } - It "Should have Path as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String[] -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } - It "Should have Destination as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Destination -Type System.String -Mandatory:$false + It "Should have Destination as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Destination } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Disable-DbaAgHadr.Tests.ps1 b/tests/Disable-DbaAgHadr.Tests.ps1 index 1a6b3c71c0..f3da1483be 100644 --- a/tests/Disable-DbaAgHadr.Tests.ps1 +++ b/tests/Disable-DbaAgHadr.Tests.ps1 @@ -10,16 +10,16 @@ Describe "Disable-DbaAgHadr" { $CommandUnderTest = Get-Command Disable-DbaAgHadr } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Disable-DbaDbEncryption.Tests.ps1 b/tests/Disable-DbaDbEncryption.Tests.ps1 index 5118327230..3d0126df67 100644 --- a/tests/Disable-DbaDbEncryption.Tests.ps1 +++ b/tests/Disable-DbaDbEncryption.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Disable-DbaDbEncryption" { $CommandUnderTest = Get-Command Disable-DbaDbEncryption } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have NoEncryptionKeyDrop as a parameter" { - $CommandUnderTest | Should -HaveParameter NoEncryptionKeyDrop -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoEncryptionKeyDrop } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Disable-DbaFilestream.Tests.ps1 b/tests/Disable-DbaFilestream.Tests.ps1 index a55485e0cb..a5ce6390f0 100644 --- a/tests/Disable-DbaFilestream.Tests.ps1 +++ b/tests/Disable-DbaFilestream.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Disable-DbaFilestream" { $CommandUnderTest = Get-Command Disable-DbaFilestream } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Disable-DbaForceNetworkEncryption.Tests.ps1 b/tests/Disable-DbaForceNetworkEncryption.Tests.ps1 index 09c0b16aba..478557aefb 100644 --- a/tests/Disable-DbaForceNetworkEncryption.Tests.ps1 +++ b/tests/Disable-DbaForceNetworkEncryption.Tests.ps1 @@ -10,13 +10,13 @@ Describe "Disable-DbaForceNetworkEncryption" { $CommandUnderTest = Get-Command Disable-DbaForceNetworkEncryption } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Microsoft.SqlServer.Management.Smo.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type Microsoft.SqlServer.Management.Smo.Credential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Disable-DbaHideInstance.Tests.ps1 b/tests/Disable-DbaHideInstance.Tests.ps1 index 8dff00a928..5273821be0 100644 --- a/tests/Disable-DbaHideInstance.Tests.ps1 +++ b/tests/Disable-DbaHideInstance.Tests.ps1 @@ -10,13 +10,13 @@ Describe "Disable-DbaHideInstance" { $CommandUnderTest = Get-Command Disable-DbaHideInstance } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Disable-DbaReplDistributor.Tests.ps1 b/tests/Disable-DbaReplDistributor.Tests.ps1 index 5099657980..7904be6af6 100644 --- a/tests/Disable-DbaReplDistributor.Tests.ps1 +++ b/tests/Disable-DbaReplDistributor.Tests.ps1 @@ -11,16 +11,16 @@ Describe "Disable-DbaReplDistributor" { $CommandUnderTest = Get-Command Disable-DbaReplDistributor } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Disable-DbaReplPublishing.Tests.ps1 b/tests/Disable-DbaReplPublishing.Tests.ps1 index 568f61c3ae..9a9ce16e17 100644 --- a/tests/Disable-DbaReplPublishing.Tests.ps1 +++ b/tests/Disable-DbaReplPublishing.Tests.ps1 @@ -11,16 +11,16 @@ Describe "Disable-DbaReplPublishing" { $CommandUnderTest = Get-Command Disable-DbaReplPublishing } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Disable-DbaStartupProcedure.Tests.ps1 b/tests/Disable-DbaStartupProcedure.Tests.ps1 index f5e0936a8d..131148cef4 100644 --- a/tests/Disable-DbaStartupProcedure.Tests.ps1 +++ b/tests/Disable-DbaStartupProcedure.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Disable-DbaStartupProcedure" { $CommandUnderTest = Get-Command Disable-DbaStartupProcedure } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have StartupProcedure parameter" { - $CommandUnderTest | Should -HaveParameter StartupProcedure -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter StartupProcedure } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Disable-DbaTraceFlag.Tests.ps1 b/tests/Disable-DbaTraceFlag.Tests.ps1 index ab6fcf778e..1e13d3d623 100644 --- a/tests/Disable-DbaTraceFlag.Tests.ps1 +++ b/tests/Disable-DbaTraceFlag.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Disable-DbaTraceFlag" { $CommandUnderTest = Get-Command Disable-DbaTraceFlag } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have TraceFlag as a parameter" { - $CommandUnderTest | Should -HaveParameter TraceFlag -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter TraceFlag } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Disconnect-DbaInstance.Tests.ps1 b/tests/Disconnect-DbaInstance.Tests.ps1 index b812eef43f..2b9234f672 100644 --- a/tests/Disconnect-DbaInstance.Tests.ps1 +++ b/tests/Disconnect-DbaInstance.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Disconnect-DbaInstance" { $CommandUnderTest = Get-Command Disconnect-DbaInstance } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Confirm } } diff --git a/tests/Dismount-DbaDatabase.Tests.ps1 b/tests/Dismount-DbaDatabase.Tests.ps1 index fa249cf88f..1537d396e6 100644 --- a/tests/Dismount-DbaDatabase.Tests.ps1 +++ b/tests/Dismount-DbaDatabase.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Dismount-DbaDatabase" { $CommandUnderTest = Get-Command Dismount-DbaDatabase } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have UpdateStatistics as a parameter" { - $CommandUnderTest | Should -HaveParameter UpdateStatistics -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter UpdateStatistics } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Enable-DbaAgHadr.Tests.ps1 b/tests/Enable-DbaAgHadr.Tests.ps1 index 4f0412a8f0..35a4236538 100644 --- a/tests/Enable-DbaAgHadr.Tests.ps1 +++ b/tests/Enable-DbaAgHadr.Tests.ps1 @@ -10,16 +10,16 @@ Describe "Enable-DbaAgHadr" { $CommandUnderTest = Get-Command Enable-DbaAgHadr } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Enable-DbaDbEncryption.Tests.ps1 b/tests/Enable-DbaDbEncryption.Tests.ps1 index a61d1a9da1..c0dde99aba 100644 --- a/tests/Enable-DbaDbEncryption.Tests.ps1 +++ b/tests/Enable-DbaDbEncryption.Tests.ps1 @@ -5,26 +5,26 @@ Describe "Enable-DbaDbEncryption" { BeforeAll { $CommandUnderTest = Get-Command Enable-DbaDbEncryption } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have EncryptorName as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter EncryptorName -Type System.String -Mandatory:$false + It "Should have EncryptorName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter EncryptorName } - It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Force as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Enable-DbaFilestream.Tests.ps1 b/tests/Enable-DbaFilestream.Tests.ps1 index d2baa0a59a..ce943f88a3 100644 --- a/tests/Enable-DbaFilestream.Tests.ps1 +++ b/tests/Enable-DbaFilestream.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Enable-DbaFilestream" { $CommandUnderTest = Get-Command Enable-DbaFilestream } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have FileStreamLevel as a parameter" { - $CommandUnderTest | Should -HaveParameter FileStreamLevel -Type System.String + $CommandUnderTest | Should -HaveParameter FileStreamLevel } It "Should have ShareName as a parameter" { - $CommandUnderTest | Should -HaveParameter ShareName -Type System.String + $CommandUnderTest | Should -HaveParameter ShareName } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Enable-DbaForceNetworkEncryption.Tests.ps1 b/tests/Enable-DbaForceNetworkEncryption.Tests.ps1 index abebb52ec5..4d1ffbe145 100644 --- a/tests/Enable-DbaForceNetworkEncryption.Tests.ps1 +++ b/tests/Enable-DbaForceNetworkEncryption.Tests.ps1 @@ -10,13 +10,13 @@ Describe "Enable-DbaForceNetworkEncryption" { $CommandUnderTest = Get-Command Enable-DbaForceNetworkEncryption } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Microsoft.SqlServer.Management.Smo.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Enable-DbaHideInstance.Tests.ps1 b/tests/Enable-DbaHideInstance.Tests.ps1 index a03be5b483..11521ca5db 100644 --- a/tests/Enable-DbaHideInstance.Tests.ps1 +++ b/tests/Enable-DbaHideInstance.Tests.ps1 @@ -10,13 +10,13 @@ Describe "Enable-DbaHideInstance" { $CommandUnderTest = Get-Command Enable-DbaHideInstance } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Enable-DbaReplDistributor.Tests.ps1 b/tests/Enable-DbaReplDistributor.Tests.ps1 index 79fc6db39d..14660b1fc1 100644 --- a/tests/Enable-DbaReplDistributor.Tests.ps1 +++ b/tests/Enable-DbaReplDistributor.Tests.ps1 @@ -11,22 +11,22 @@ Describe "Enable-DbaReplDistributor" { $CommandUnderTest = Get-Command Enable-DbaReplDistributor } It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have DistributionDatabase as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter DistributionDatabase -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DistributionDatabase } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Confirm } } } diff --git a/tests/Enable-DbaReplPublishing.Tests.ps1 b/tests/Enable-DbaReplPublishing.Tests.ps1 index fa01142b8a..408f96635a 100644 --- a/tests/Enable-DbaReplPublishing.Tests.ps1 +++ b/tests/Enable-DbaReplPublishing.Tests.ps1 @@ -11,25 +11,25 @@ Describe "Enable-DbaReplPublishing" { $CommandUnderTest = Get-Command Enable-DbaReplPublishing } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have SnapshotShare as a parameter" { - $CommandUnderTest | Should -HaveParameter SnapshotShare -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SnapshotShare } It "Should have PublisherSqlLogin as a parameter" { - $CommandUnderTest | Should -HaveParameter PublisherSqlLogin -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PublisherSqlLogin } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Confirm } } } diff --git a/tests/Enable-DbaStartupProcedure.Tests.ps1 b/tests/Enable-DbaStartupProcedure.Tests.ps1 index e704431ca5..5c5e4d1cc1 100644 --- a/tests/Enable-DbaStartupProcedure.Tests.ps1 +++ b/tests/Enable-DbaStartupProcedure.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Enable-DbaStartupProcedure" { $CommandUnderTest = Get-Command Enable-DbaStartupProcedure } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have StartupProcedure as a parameter" { - $CommandUnderTest | Should -HaveParameter StartupProcedure -Type System.Object[] + $CommandUnderTest | Should -HaveParameter StartupProcedure } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Enable-DbaTraceFlag.Tests.ps1 b/tests/Enable-DbaTraceFlag.Tests.ps1 index 1841e2132b..1426294c34 100644 --- a/tests/Enable-DbaTraceFlag.Tests.ps1 +++ b/tests/Enable-DbaTraceFlag.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Enable-DbaTraceFlag" { $CommandUnderTest = Get-Command Enable-DbaTraceFlag } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have TraceFlag as a parameter" { - $CommandUnderTest | Should -HaveParameter TraceFlag -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter TraceFlag } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Expand-DbaDbLogFile.Tests.ps1 b/tests/Expand-DbaDbLogFile.Tests.ps1 index 551264f549..f3496755c7 100644 --- a/tests/Expand-DbaDbLogFile.Tests.ps1 +++ b/tests/Expand-DbaDbLogFile.Tests.ps1 @@ -14,40 +14,40 @@ Describe "Expand-DbaDbLogFile" { $CommandUnderTest = Get-Command Expand-DbaDbLogFile } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have TargetLogSize parameter" { - $CommandUnderTest | Should -HaveParameter TargetLogSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter TargetLogSize } It "Should have IncrementSize parameter" { - $CommandUnderTest | Should -HaveParameter IncrementSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter IncrementSize } It "Should have LogFileId parameter" { - $CommandUnderTest | Should -HaveParameter LogFileId -Type System.Int32 + $CommandUnderTest | Should -HaveParameter LogFileId } It "Should have ShrinkLogFile parameter" { - $CommandUnderTest | Should -HaveParameter ShrinkLogFile -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ShrinkLogFile } It "Should have ShrinkSize parameter" { - $CommandUnderTest | Should -HaveParameter ShrinkSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter ShrinkSize } It "Should have BackupDirectory parameter" { - $CommandUnderTest | Should -HaveParameter BackupDirectory -Type System.String + $CommandUnderTest | Should -HaveParameter BackupDirectory } It "Should have ExcludeDiskSpaceValidation parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDiskSpaceValidation -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeDiskSpaceValidation } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Export-DbaBinaryFile.Tests.ps1 b/tests/Export-DbaBinaryFile.Tests.ps1 index 65cfdc6b03..71474561b0 100644 --- a/tests/Export-DbaBinaryFile.Tests.ps1 +++ b/tests/Export-DbaBinaryFile.Tests.ps1 @@ -12,40 +12,40 @@ Describe "Export-DbaBinaryFile" { $CommandUnderTest = Get-Command Export-DbaBinaryFile } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Table as a parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Table } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Schema } It "Should have FileNameColumn as a parameter" { - $CommandUnderTest | Should -HaveParameter FileNameColumn -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FileNameColumn } It "Should have BinaryColumn as a parameter" { - $CommandUnderTest | Should -HaveParameter BinaryColumn -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter BinaryColumn } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have Query as a parameter" { - $CommandUnderTest | Should -HaveParameter Query -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Query } It "Should have FilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type [Microsoft.SqlServer.Management.Smo.Table[]] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Export-DbaCredential.Tests.ps1 b/tests/Export-DbaCredential.Tests.ps1 index c10d3ce9a7..9b8996c206 100644 --- a/tests/Export-DbaCredential.Tests.ps1 +++ b/tests/Export-DbaCredential.Tests.ps1 @@ -5,35 +5,35 @@ Describe "Export-DbaCredential Unit Tests" -Tag 'UnitTests' { BeforeAll { $CommandUnderTest = Get-Command Export-DbaCredential } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have Identity as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Identity -Type System.String[] -Mandatory:$false + It "Should have Identity as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Identity } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } - It "Should have Path as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } - It "Should have FilePath as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String -Mandatory:$false + It "Should have FilePath as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have ExcludePassword as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludePassword -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludePassword } It "Should have Append as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Append } - It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Credential[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Credential[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Export-DbaDacPackage.Tests.ps1 b/tests/Export-DbaDacPackage.Tests.ps1 index f5b7065b31..21c8a96407 100644 --- a/tests/Export-DbaDacPackage.Tests.ps1 +++ b/tests/Export-DbaDacPackage.Tests.ps1 @@ -5,44 +5,44 @@ Describe "Export-DbaDacPackage" { BeforeAll { $CommandUnderTest = Get-Command Export-DbaDacPackage } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type Microsoft.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have ExcludeDatabase as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + It "Should have ExcludeDatabase as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have AllUserDatabases as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter AllUserDatabases -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AllUserDatabases } - It "Should have Path as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } - It "Should have FilePath as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String -Mandatory:$false + It "Should have FilePath as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter FilePath } - It "Should have DacOption as a non-mandatory parameter of type System.Object" { - $CommandUnderTest | Should -HaveParameter DacOption -Type System.Object -Mandatory:$false + It "Should have DacOption as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter DacOption } - It "Should have ExtendedParameters as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter ExtendedParameters -Type System.String -Mandatory:$false + It "Should have ExtendedParameters as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExtendedParameters } - It "Should have ExtendedProperties as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter ExtendedProperties -Type System.String -Mandatory:$false + It "Should have ExtendedProperties as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExtendedProperties } - It "Should have Type as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String -Mandatory:$false + It "Should have Type as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Type } - It "Should have Table as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] -Mandatory:$false + It "Should have Table as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Table } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Export-DbaDbRole.Tests.ps1 b/tests/Export-DbaDbRole.Tests.ps1 index 7eb1216eee..b1eb23d75b 100644 --- a/tests/Export-DbaDbRole.Tests.ps1 +++ b/tests/Export-DbaDbRole.Tests.ps1 @@ -6,58 +6,58 @@ Describe "Export-DbaDbRole Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Export-DbaDbRole } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Microsoft.SqlServer.Management.Smo.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have ScriptingOptionsObject parameter" { - $CommandUnderTest | Should -HaveParameter ScriptingOptionsObject -Type Microsoft.SqlServer.Management.Smo.ScriptingOptions -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ScriptingOptionsObject } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Role parameter" { - $CommandUnderTest | Should -HaveParameter Role -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Role } It "Should have ExcludeRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeRole -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeRole } It "Should have ExcludeFixedRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeFixedRole -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeFixedRole } It "Should have IncludeRoleMember parameter" { - $CommandUnderTest | Should -HaveParameter IncludeRoleMember -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeRoleMember } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have FilePath parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have Passthru parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Passthru } It "Should have BatchSeparator parameter" { - $CommandUnderTest | Should -HaveParameter BatchSeparator -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter BatchSeparator } It "Should have NoClobber parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoClobber } It "Should have Append parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Append } It "Should have NoPrefix parameter" { - $CommandUnderTest | Should -HaveParameter NoPrefix -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoPrefix } It "Should have Encoding parameter" { - $CommandUnderTest | Should -HaveParameter Encoding -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Encoding } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Export-DbaDbTableData.Tests.ps1 b/tests/Export-DbaDbTableData.Tests.ps1 index 60520a6416..013bed429a 100644 --- a/tests/Export-DbaDbTableData.Tests.ps1 +++ b/tests/Export-DbaDbTableData.Tests.ps1 @@ -6,34 +6,34 @@ Describe "Export-DbaDbTableData" { $CommandUnderTest = Get-Command Export-DbaDbTableData } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type [Microsoft.SqlServer.Management.Smo.Table[]] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type [System.String] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have FilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type [System.String] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have Encoding as a parameter" { - $CommandUnderTest | Should -HaveParameter Encoding -Type [System.String] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Encoding } It "Should have BatchSeparator as a parameter" { - $CommandUnderTest | Should -HaveParameter BatchSeparator -Type [System.String] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter BatchSeparator } It "Should have NoPrefix as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoPrefix -Type [System.Management.Automation.SwitchParameter] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoPrefix } It "Should have Passthru as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type [System.Management.Automation.SwitchParameter] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Passthru } It "Should have NoClobber as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type [System.Management.Automation.SwitchParameter] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoClobber } It "Should have Append as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type [System.Management.Automation.SwitchParameter] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Append } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type [System.Management.Automation.SwitchParameter] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Export-DbaDiagnosticQuery.Tests.ps1 b/tests/Export-DbaDiagnosticQuery.Tests.ps1 index 6524dc0d18..d00ee6a916 100644 --- a/tests/Export-DbaDiagnosticQuery.Tests.ps1 +++ b/tests/Export-DbaDiagnosticQuery.Tests.ps1 @@ -12,25 +12,25 @@ Describe "Export-DbaDiagnosticQuery" { $CommandUnderTest = Get-Command Export-DbaDiagnosticQuery } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have ConvertTo as a parameter" { - $CommandUnderTest | Should -HaveParameter ConvertTo -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ConvertTo } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.IO.FileInfo -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have Suffix as a parameter" { - $CommandUnderTest | Should -HaveParameter Suffix -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Suffix } It "Should have NoPlanExport as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoPlanExport -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoPlanExport } It "Should have NoQueryExport as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoQueryExport -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoQueryExport } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Export-DbaExecutionPlan.Tests.ps1 b/tests/Export-DbaExecutionPlan.Tests.ps1 index 0fe613623c..3d9841f191 100644 --- a/tests/Export-DbaExecutionPlan.Tests.ps1 +++ b/tests/Export-DbaExecutionPlan.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Export-DbaExecutionPlan" { $CommandUnderTest = Get-Command Export-DbaExecutionPlan } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have SinceCreation parameter" { - $CommandUnderTest | Should -HaveParameter SinceCreation -Type System.DateTime + $CommandUnderTest | Should -HaveParameter SinceCreation } It "Should have SinceLastExecution parameter" { - $CommandUnderTest | Should -HaveParameter SinceLastExecution -Type System.DateTime + $CommandUnderTest | Should -HaveParameter SinceLastExecution } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Export-DbaInstance.Tests.ps1 b/tests/Export-DbaInstance.Tests.ps1 index 07eba7a3fe..36033bbd9e 100644 --- a/tests/Export-DbaInstance.Tests.ps1 +++ b/tests/Export-DbaInstance.Tests.ps1 @@ -12,46 +12,46 @@ Describe "Export-DbaInstance Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Export-DbaInstance } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have NoRecovery as a parameter" { - $CommandUnderTest | Should -HaveParameter NoRecovery -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoRecovery } It "Should have AzureCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter AzureCredential -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AzureCredential } It "Should have IncludeDbMasterKey as a parameter" { - $CommandUnderTest | Should -HaveParameter IncludeDbMasterKey -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeDbMasterKey } It "Should have Exclude as a parameter" { - $CommandUnderTest | Should -HaveParameter Exclude -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Exclude } It "Should have BatchSeparator as a parameter" { - $CommandUnderTest | Should -HaveParameter BatchSeparator -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter BatchSeparator } It "Should have ScriptingOption as a parameter" { - $CommandUnderTest | Should -HaveParameter ScriptingOption -Type Microsoft.SqlServer.Management.Smo.ScriptingOptions -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ScriptingOption } It "Should have NoPrefix as a parameter" { - $CommandUnderTest | Should -HaveParameter NoPrefix -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoPrefix } It "Should have ExcludePassword as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludePassword -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludePassword } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } @@ -233,7 +233,7 @@ Describe "Export-DbaInstance Integration Tests" -Tag "IntegrationTests" { } It "Exports server roles" { - $results = Export-DbaInstance -SqlInstance $testServer -Path $exportDir -Exclude 'AgentServer', 'Audits', 'AvailabilityGroups', 'BackupDevices', 'CentralManagementServer', 'Credentials', 'CustomErrors', 'DatabaseMail', 'Databases', 'Endpoints', 'ExtendedEvents', 'LinkedServers', 'Logins', 'PolicyManagement', 'ReplicationSettings', 'ResourceGovernor', 'ServerAuditSpecifications', 'SpConfigure', 'SysDbUserObjects', 'SystemTriggers', 'OleDbProvider' + $results = Export-DbaInstance -SqlInstance $testServer -Path $exportDir -Exclude 'AgentServer', 'Audits', 'AvailabilityGroups', 'BackupDevices', 'CentralManagementServer', 'Credentials', 'CustomErrors', 'DatabaseMail', 'Databases', 'Endpoints', 'ExtendedEvents', 'LinkedServers', 'Logins', 'PolicyManagement', 'ReplicationSettings', 'ResourceGovernor', 'ServerAuditSpecifications', 'ServerRoles', 'SpConfigure', 'SysDbUserObjects', 'SystemTriggers', 'OleDbProvider' $results.FullName | Should -Exist $results.Count | Should -BeGreaterThan 0 @@ -352,7 +352,7 @@ Describe "Export-DbaInstance Integration Tests" -Tag "IntegrationTests" { } It "Exports oledb providers" { - $results = Export-DbaInstance -SqlInstance $testServer -Path $exportDir -Exclude 'AgentServer', 'Audits', 'AvailabilityGroups', 'BackupDevices', 'CentralManagementServer', 'Credentials', 'CustomErrors', 'DatabaseMail', 'Databases', 'Endpoints', 'ExtendedEvents', 'LinkedServers', 'Logins', 'PolicyManagement', 'ReplicationSettings', 'ResourceGovernor', 'ServerAuditSpecifications', 'ServerRoles', 'SpConfigure', 'SystemTriggers', 'SysDbUserObjects' + $results = Export-DbaInstance -SqlInstance $testServer -Path $exportDir -Exclude 'AgentServer', 'Audits', 'AvailabilityGroups', 'BackupDevices', 'CentralManagementServer', 'Credentials', 'CustomErrors', 'DatabaseMail', 'Databases', 'Endpoints', 'ExtendedEvents', 'LinkedServers', 'Logins', 'PolicyManagement', 'ReplicationSettings', 'ResourceGovernor', 'ServerAuditSpecifications', 'ServerRoles', 'SpConfigure', 'SysDbUserObjects' $results.FullName | Should -Exist $results.Count | Should -BeGreaterThan 0 diff --git a/tests/Export-DbaLinkedServer.Tests.ps1 b/tests/Export-DbaLinkedServer.Tests.ps1 index bee9e0e2bb..d346856791 100644 --- a/tests/Export-DbaLinkedServer.Tests.ps1 +++ b/tests/Export-DbaLinkedServer.Tests.ps1 @@ -6,34 +6,34 @@ Describe "Export-DbaLinkedServer" { $CommandUnderTest = Get-Command Export-DbaLinkedServer } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have LinkedServer as a parameter" { - $CommandUnderTest | Should -HaveParameter LinkedServer -Type System.String[] + $CommandUnderTest | Should -HaveParameter LinkedServer } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have FilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have ExcludePassword as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludePassword -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludePassword } It "Should have Append as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Append } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.LinkedServer[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Export-DbaLogin.Tests.ps1 b/tests/Export-DbaLogin.Tests.ps1 index be268626df..05324ecf17 100644 --- a/tests/Export-DbaLogin.Tests.ps1 +++ b/tests/Export-DbaLogin.Tests.ps1 @@ -61,67 +61,67 @@ Describe "Export-DbaLogin" { $CommandUnderTest = Get-Command Export-DbaLogin } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Login } It "Should have ExcludeLogin as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeLogin -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeLogin } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeJobs as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeJobs -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeJobs } It "Should have ExcludeDatabase as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have ExcludePassword as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludePassword -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludePassword } It "Should have DefaultDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter DefaultDatabase -Type System.String + $CommandUnderTest | Should -HaveParameter DefaultDatabase } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have FilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have Encoding as a parameter" { - $CommandUnderTest | Should -HaveParameter Encoding -Type System.String + $CommandUnderTest | Should -HaveParameter Encoding } It "Should have NoClobber as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoClobber } It "Should have Append as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Append } It "Should have BatchSeparator as a parameter" { - $CommandUnderTest | Should -HaveParameter BatchSeparator -Type System.String + $CommandUnderTest | Should -HaveParameter BatchSeparator } It "Should have DestinationVersion as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationVersion -Type System.String + $CommandUnderTest | Should -HaveParameter DestinationVersion } It "Should have NoPrefix as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoPrefix -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoPrefix } It "Should have Passthru as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Passthru } It "Should have ObjectLevel as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ObjectLevel -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ObjectLevel } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Export-DbaPfDataCollectorSetTemplate.Tests.ps1 b/tests/Export-DbaPfDataCollectorSetTemplate.Tests.ps1 index a7f3526fcf..08c0b28a61 100644 --- a/tests/Export-DbaPfDataCollectorSetTemplate.Tests.ps1 +++ b/tests/Export-DbaPfDataCollectorSetTemplate.Tests.ps1 @@ -10,25 +10,25 @@ Describe "Export-DbaPfDataCollectorSetTemplate" { $CommandUnderTest = Get-Command Export-DbaPfDataCollectorSetTemplate } It "Should have ComputerName as a non-mandatory DbaInstanceParameter[] parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have CollectorSet as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter CollectorSet -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CollectorSet } It "Should have Path as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have FilePath as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have InputObject as a non-mandatory Object[] parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory Switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Export-DbaRegServer.Tests.ps1 b/tests/Export-DbaRegServer.Tests.ps1 index 8d9039f5fd..9b95754e67 100644 --- a/tests/Export-DbaRegServer.Tests.ps1 +++ b/tests/Export-DbaRegServer.Tests.ps1 @@ -9,34 +9,34 @@ Describe "Export-DbaRegServer" { $CommandUnderTest = Get-Command Export-DbaRegServer } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have FilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.IO.FileInfo + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have CredentialPersistenceType as a parameter" { - $CommandUnderTest | Should -HaveParameter CredentialPersistenceType -Type System.String + $CommandUnderTest | Should -HaveParameter CredentialPersistenceType } It "Should have Group as a parameter" { - $CommandUnderTest | Should -HaveParameter Group -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Group } It "Should have ExcludeGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeGroup -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeGroup } It "Should have Overwrite as a parameter" { - $CommandUnderTest | Should -HaveParameter Overwrite -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Overwrite } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Export-DbaReplServerSetting.Tests.ps1 b/tests/Export-DbaReplServerSetting.Tests.ps1 index 808a88d4e7..3ca922d155 100644 --- a/tests/Export-DbaReplServerSetting.Tests.ps1 +++ b/tests/Export-DbaReplServerSetting.Tests.ps1 @@ -13,38 +13,38 @@ Describe "Export-DbaReplServerSetting" { BeforeAll { $CommandUnderTest = Get-Command Export-DbaReplServerSetting } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Path as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } - It "Should have FilePath as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String -Mandatory:$false + It "Should have FilePath as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter FilePath } - It "Should have ScriptOption as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter ScriptOption -Type System.Object[] -Mandatory:$false + It "Should have ScriptOption as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ScriptOption } - It "Should have InputObject as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } - It "Should have Encoding as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Encoding -Type System.String -Mandatory:$false + It "Should have Encoding as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Encoding } It "Should have Passthru as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Passthru } It "Should have NoClobber as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoClobber } It "Should have Append as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Append } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Export-DbaScript.Tests.ps1 b/tests/Export-DbaScript.Tests.ps1 index 51b4d6aaf4..dfda8e4a9e 100644 --- a/tests/Export-DbaScript.Tests.ps1 +++ b/tests/Export-DbaScript.Tests.ps1 @@ -12,37 +12,37 @@ Describe "Export-DbaScript" { $CommandUnderTest = Get-Command Export-DbaScript } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have ScriptingOptionsObject as a parameter" { - $CommandUnderTest | Should -HaveParameter ScriptingOptionsObject -Type Microsoft.SqlServer.Management.Smo.ScriptingOptions + $CommandUnderTest | Should -HaveParameter ScriptingOptionsObject } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have FilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have Encoding as a parameter" { - $CommandUnderTest | Should -HaveParameter Encoding -Type System.String + $CommandUnderTest | Should -HaveParameter Encoding } It "Should have BatchSeparator as a parameter" { - $CommandUnderTest | Should -HaveParameter BatchSeparator -Type System.String + $CommandUnderTest | Should -HaveParameter BatchSeparator } It "Should have NoPrefix as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoPrefix -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoPrefix } It "Should have Passthru as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Passthru } It "Should have NoClobber as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoClobber } It "Should have Append as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Append } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Export-DbaServerRole.Tests.ps1 b/tests/Export-DbaServerRole.Tests.ps1 index 5e8d4f2547..5f95df0223 100644 --- a/tests/Export-DbaServerRole.Tests.ps1 +++ b/tests/Export-DbaServerRole.Tests.ps1 @@ -12,55 +12,55 @@ Describe "Export-DbaServerRole Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Export-DbaServerRole } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have ScriptingOptionsObject parameter" { - $CommandUnderTest | Should -HaveParameter ScriptingOptionsObject -Type Microsoft.SqlServer.Management.Smo.ScriptingOptions -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ScriptingOptionsObject } It "Should have ServerRole parameter" { - $CommandUnderTest | Should -HaveParameter ServerRole -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ServerRole } It "Should have ExcludeServerRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeServerRole -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeServerRole } It "Should have ExcludeFixedRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeFixedRole -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeFixedRole } It "Should have IncludeRoleMember parameter" { - $CommandUnderTest | Should -HaveParameter IncludeRoleMember -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeRoleMember } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have FilePath parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have Passthru parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Passthru } It "Should have BatchSeparator parameter" { - $CommandUnderTest | Should -HaveParameter BatchSeparator -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter BatchSeparator } It "Should have NoClobber parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoClobber } It "Should have Append parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Append } It "Should have NoPrefix parameter" { - $CommandUnderTest | Should -HaveParameter NoPrefix -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoPrefix } It "Should have Encoding parameter" { - $CommandUnderTest | Should -HaveParameter Encoding -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Encoding } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Export-DbaSpConfigure.Tests.ps1 b/tests/Export-DbaSpConfigure.Tests.ps1 index 8063a587e9..1cf350b20f 100644 --- a/tests/Export-DbaSpConfigure.Tests.ps1 +++ b/tests/Export-DbaSpConfigure.Tests.ps1 @@ -10,19 +10,19 @@ Describe "Export-DbaSpConfigure" { $CommandUnderTest = Get-Command Export-DbaSpConfigure } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Microsoft.SqlServer.Management.Smo.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have FilePath parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Export-DbaSysDbUserObject.Tests.ps1 b/tests/Export-DbaSysDbUserObject.Tests.ps1 index a2671275b0..8221ebde48 100644 --- a/tests/Export-DbaSysDbUserObject.Tests.ps1 +++ b/tests/Export-DbaSysDbUserObject.Tests.ps1 @@ -6,37 +6,37 @@ Describe "Export-DbaSysDbUserObject" { $CommandUnderTest = Get-Command Export-DbaSysDbUserObject } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have IncludeDependencies as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeDependencies -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeDependencies } It "Should have BatchSeparator as a string parameter" { - $CommandUnderTest | Should -HaveParameter BatchSeparator -Type System.String + $CommandUnderTest | Should -HaveParameter BatchSeparator } It "Should have Path as a string parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have FilePath as a string parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have NoPrefix as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoPrefix -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoPrefix } It "Should have ScriptingOptionsObject as a ScriptingOptions parameter" { - $CommandUnderTest | Should -HaveParameter ScriptingOptionsObject -Type Microsoft.SqlServer.Management.Smo.ScriptingOptions + $CommandUnderTest | Should -HaveParameter ScriptingOptionsObject } It "Should have NoClobber as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoClobber } It "Should have PassThru as a switch parameter" { - $CommandUnderTest | Should -HaveParameter PassThru -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter PassThru } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Export-DbaUser.Tests.ps1 b/tests/Export-DbaUser.Tests.ps1 index a9bc27e03a..7275da09cb 100644 --- a/tests/Export-DbaUser.Tests.ps1 +++ b/tests/Export-DbaUser.Tests.ps1 @@ -6,55 +6,55 @@ Describe "Export-DbaUser Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Export-DbaUser } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have User parameter" { - $CommandUnderTest | Should -HaveParameter User -Type String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter User } It "Should have DestinationVersion parameter" { - $CommandUnderTest | Should -HaveParameter DestinationVersion -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DestinationVersion } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have FilePath parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have Encoding parameter" { - $CommandUnderTest | Should -HaveParameter Encoding -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Encoding } It "Should have NoClobber parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoClobber } It "Should have Append parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Append } It "Should have Passthru parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Passthru } It "Should have Template parameter" { - $CommandUnderTest | Should -HaveParameter Template -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Template } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have ScriptingOptionsObject parameter" { - $CommandUnderTest | Should -HaveParameter ScriptingOptionsObject -Type Microsoft.SqlServer.Management.Smo.ScriptingOptions -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ScriptingOptionsObject } It "Should have ExcludeGoBatchSeparator parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeGoBatchSeparator -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeGoBatchSeparator } } } diff --git a/tests/Export-DbaXECsv.Tests.ps1 b/tests/Export-DbaXECsv.Tests.ps1 index 48926f2fcb..31b1df1e38 100644 --- a/tests/Export-DbaXECsv.Tests.ps1 +++ b/tests/Export-DbaXECsv.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Export-DbaXECsv" { $CommandUnderTest = Get-Command Export-DbaXECsv } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have FilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Export-DbaXESession.Tests.ps1 b/tests/Export-DbaXESession.Tests.ps1 index 3847599d3b..fb601c0b3c 100644 --- a/tests/Export-DbaXESession.Tests.ps1 +++ b/tests/Export-DbaXESession.Tests.ps1 @@ -19,43 +19,43 @@ Describe "Export-DbaXESession" { $CommandUnderTest = Get-Command Export-DbaXESession } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.XEvent.Session[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Session parameter" { - $CommandUnderTest | Should -HaveParameter Session -Type String[] + $CommandUnderTest | Should -HaveParameter Session } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String + $CommandUnderTest | Should -HaveParameter Path } It "Should have FilePath parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type String + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have Encoding parameter" { - $CommandUnderTest | Should -HaveParameter Encoding -Type String + $CommandUnderTest | Should -HaveParameter Encoding } It "Should have Passthru parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Passthru } It "Should have BatchSeparator parameter" { - $CommandUnderTest | Should -HaveParameter BatchSeparator -Type String + $CommandUnderTest | Should -HaveParameter BatchSeparator } It "Should have NoPrefix parameter" { - $CommandUnderTest | Should -HaveParameter NoPrefix -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoPrefix } It "Should have NoClobber parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoClobber } It "Should have Append parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Append } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Export-DbaXESessionTemplate.Tests.ps1 b/tests/Export-DbaXESessionTemplate.Tests.ps1 index 5f220c9f61..e09a2de2e1 100644 --- a/tests/Export-DbaXESessionTemplate.Tests.ps1 +++ b/tests/Export-DbaXESessionTemplate.Tests.ps1 @@ -5,26 +5,26 @@ Describe "Export-DbaXESessionTemplate" { BeforeAll { $CommandUnderTest = Get-Command Export-DbaXESessionTemplate } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Session as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Session -Type System.Object[] -Mandatory:$false + It "Should have Session as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Session } - It "Should have Path as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } - It "Should have FilePath as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String -Mandatory:$false + It "Should have FilePath as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter FilePath } - It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.XEvent.Session[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.XEvent.Session[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Export-DbatoolsConfig.Tests.ps1 b/tests/Export-DbatoolsConfig.Tests.ps1 index d3fbb3fc22..b6147ab5dd 100644 --- a/tests/Export-DbatoolsConfig.Tests.ps1 +++ b/tests/Export-DbatoolsConfig.Tests.ps1 @@ -12,34 +12,34 @@ Describe "Export-DbatoolsConfig" { $CommandUnderTest = Get-Command Export-DbatoolsConfig } It "Should have FullName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter FullName -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FullName } It "Should have Module as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Module -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Module } It "Should have Name as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Name } It "Should have Config as a non-mandatory Config[] parameter" { - $CommandUnderTest | Should -HaveParameter Config -Type Dataplat.Dbatools.Configuration.Config[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Config } It "Should have ModuleName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ModuleName -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ModuleName } It "Should have ModuleVersion as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter ModuleVersion -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ModuleVersion } It "Should have Scope as a non-mandatory ConfigScope parameter" { - $CommandUnderTest | Should -HaveParameter Scope -Type Dataplat.Dbatools.Configuration.ConfigScope -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Scope } It "Should have OutPath as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter OutPath -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OutPath } It "Should have SkipUnchanged as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter SkipUnchanged -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SkipUnchanged } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Find-DbaAgentJob.Tests.ps1 b/tests/Find-DbaAgentJob.Tests.ps1 index 75ebf454a8..6c985b2fd7 100644 --- a/tests/Find-DbaAgentJob.Tests.ps1 +++ b/tests/Find-DbaAgentJob.Tests.ps1 @@ -12,46 +12,46 @@ Describe "Find-DbaAgentJob Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Find-DbaAgentJob } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have JobName as a parameter" { - $CommandUnderTest | Should -HaveParameter JobName -Type System.String[] + $CommandUnderTest | Should -HaveParameter JobName } It "Should have ExcludeJobName as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeJobName -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeJobName } It "Should have StepName as a parameter" { - $CommandUnderTest | Should -HaveParameter StepName -Type System.String[] + $CommandUnderTest | Should -HaveParameter StepName } It "Should have LastUsed as a parameter" { - $CommandUnderTest | Should -HaveParameter LastUsed -Type System.Int32 + $CommandUnderTest | Should -HaveParameter LastUsed } It "Should have IsDisabled as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IsDisabled -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IsDisabled } It "Should have IsFailed as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IsFailed -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IsFailed } It "Should have IsNotScheduled as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IsNotScheduled -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IsNotScheduled } It "Should have IsNoEmailNotification as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IsNoEmailNotification -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IsNoEmailNotification } It "Should have Category as a parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type System.String[] + $CommandUnderTest | Should -HaveParameter Category } It "Should have Owner as a parameter" { - $CommandUnderTest | Should -HaveParameter Owner -Type System.String + $CommandUnderTest | Should -HaveParameter Owner } It "Should have Since as a parameter" { - $CommandUnderTest | Should -HaveParameter Since -Type System.DateTime + $CommandUnderTest | Should -HaveParameter Since } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Find-DbaBackup.Tests.ps1 b/tests/Find-DbaBackup.Tests.ps1 index 8d16e35657..12ec020e41 100644 --- a/tests/Find-DbaBackup.Tests.ps1 +++ b/tests/Find-DbaBackup.Tests.ps1 @@ -17,19 +17,19 @@ Describe "Find-DbaBackup" { $CommandUnderTest = Get-Command Find-DbaBackup } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have BackupFileExtension as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupFileExtension -Type System.String + $CommandUnderTest | Should -HaveParameter BackupFileExtension } It "Should have RetentionPeriod as a parameter" { - $CommandUnderTest | Should -HaveParameter RetentionPeriod -Type System.String + $CommandUnderTest | Should -HaveParameter RetentionPeriod } It "Should have CheckArchiveBit as a parameter" { - $CommandUnderTest | Should -HaveParameter CheckArchiveBit -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter CheckArchiveBit } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Find-DbaCommand.Tests.ps1 b/tests/Find-DbaCommand.Tests.ps1 index 7e56298176..c1eb68c275 100644 --- a/tests/Find-DbaCommand.Tests.ps1 +++ b/tests/Find-DbaCommand.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Find-DbaCommand" { $CommandUnderTest = Get-Command Find-DbaCommand } It "Should have Pattern as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Pattern -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Pattern } It "Should have Tag as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Tag -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Tag } It "Should have Author as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Author -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Author } It "Should have MinimumVersion as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter MinimumVersion -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MinimumVersion } It "Should have MaximumVersion as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter MaximumVersion -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaximumVersion } It "Should have Rebuild as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Rebuild -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Rebuild } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Find-DbaDatabase.Tests.ps1 b/tests/Find-DbaDatabase.Tests.ps1 index 7530ab8c16..60e50ac886 100644 --- a/tests/Find-DbaDatabase.Tests.ps1 +++ b/tests/Find-DbaDatabase.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Find-DbaDatabase" { $CommandUnderTest = Get-Command Find-DbaDatabase } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Property as a parameter" { - $CommandUnderTest | Should -HaveParameter Property -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Property } It "Should have Pattern as a parameter" { - $CommandUnderTest | Should -HaveParameter Pattern -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Pattern } It "Should have Exact as a parameter" { - $CommandUnderTest | Should -HaveParameter Exact -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Exact } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Find-DbaDbDisabledIndex.Tests.ps1 b/tests/Find-DbaDbDisabledIndex.Tests.ps1 index 4f5ece4f1d..a39e30d95a 100644 --- a/tests/Find-DbaDbDisabledIndex.Tests.ps1 +++ b/tests/Find-DbaDbDisabledIndex.Tests.ps1 @@ -12,25 +12,25 @@ Describe "Find-DbaDbDisabledIndex" { $CommandUnderTest = Get-Command Find-DbaDbDisabledIndex } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have NoClobber as a parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoClobber } It "Should have Append as a parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Append } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Find-DbaDbDuplicateIndex.Tests.ps1 b/tests/Find-DbaDbDuplicateIndex.Tests.ps1 index 1bb96ea906..0c76864e2d 100644 --- a/tests/Find-DbaDbDuplicateIndex.Tests.ps1 +++ b/tests/Find-DbaDbDuplicateIndex.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Find-DbaDbDuplicateIndex" { $CommandUnderTest = Get-Command Find-DbaDbDuplicateIndex } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have IncludeOverlapping as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeOverlapping -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeOverlapping } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Find-DbaDbGrowthEvent.Tests.ps1 b/tests/Find-DbaDbGrowthEvent.Tests.ps1 index 21f6f3430f..bafea1d70e 100644 --- a/tests/Find-DbaDbGrowthEvent.Tests.ps1 +++ b/tests/Find-DbaDbGrowthEvent.Tests.ps1 @@ -12,28 +12,28 @@ Describe "Find-DbaDbGrowthEvent" { $CommandUnderTest = Get-Command Find-DbaDbGrowthEvent } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have EventType as a parameter" { - $CommandUnderTest | Should -HaveParameter EventType -Type System.String + $CommandUnderTest | Should -HaveParameter EventType } It "Should have FileType as a parameter" { - $CommandUnderTest | Should -HaveParameter FileType -Type System.String + $CommandUnderTest | Should -HaveParameter FileType } It "Should have UseLocalTime as a parameter" { - $CommandUnderTest | Should -HaveParameter UseLocalTime -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter UseLocalTime } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Find-DbaDbUnusedIndex.Tests.ps1 b/tests/Find-DbaDbUnusedIndex.Tests.ps1 index e9889054a3..c22c7fc59b 100644 --- a/tests/Find-DbaDbUnusedIndex.Tests.ps1 +++ b/tests/Find-DbaDbUnusedIndex.Tests.ps1 @@ -6,34 +6,34 @@ Describe "Find-DbaDbUnusedIndex" { $CommandUnderTest = Get-Command Find-DbaDbUnusedIndex } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have IgnoreUptime parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreUptime -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IgnoreUptime } It "Should have Seeks parameter" { - $CommandUnderTest | Should -HaveParameter Seeks -Type System.Int32 + $CommandUnderTest | Should -HaveParameter Seeks } It "Should have Scans parameter" { - $CommandUnderTest | Should -HaveParameter Scans -Type System.Int32 + $CommandUnderTest | Should -HaveParameter Scans } It "Should have Lookups parameter" { - $CommandUnderTest | Should -HaveParameter Lookups -Type System.Int32 + $CommandUnderTest | Should -HaveParameter Lookups } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Find-DbaInstance.Tests.ps1 b/tests/Find-DbaInstance.Tests.ps1 index c2da647404..5a6c5ebeb1 100644 --- a/tests/Find-DbaInstance.Tests.ps1 +++ b/tests/Find-DbaInstance.Tests.ps1 @@ -5,35 +5,35 @@ Describe "Find-DbaInstance" { BeforeAll { $CommandUnderTest = Get-Command Find-DbaInstance } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have DiscoveryType as a non-mandatory parameter of type Dataplat.Dbatools.Discovery.DbaInstanceDiscoveryType" { - $CommandUnderTest | Should -HaveParameter DiscoveryType -Type Dataplat.Dbatools.Discovery.DbaInstanceDiscoveryType -Mandatory:$false + It "Should have DiscoveryType as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter DiscoveryType } - It "Should have Credential as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type Microsoft.SqlServer.Management.Smo.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } - It "Should have SqlCredential as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.SqlServer.Management.Smo.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have ScanType as a non-mandatory parameter of type Dataplat.Dbatools.Discovery.DbaInstanceScanType[]" { - $CommandUnderTest | Should -HaveParameter ScanType -Type Dataplat.Dbatools.Discovery.DbaInstanceScanType[] -Mandatory:$false + It "Should have ScanType as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ScanType } - It "Should have IpAddress as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter IpAddress -Type System.String[] -Mandatory:$false + It "Should have IpAddress as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter IpAddress } - It "Should have DomainController as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter DomainController -Type System.String -Mandatory:$false + It "Should have DomainController as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter DomainController } - It "Should have TCPPort as a non-mandatory parameter of type System.Int32[]" { - $CommandUnderTest | Should -HaveParameter TCPPort -Type System.Int32[] -Mandatory:$false + It "Should have TCPPort as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter TCPPort } - It "Should have MinimumConfidence as a non-mandatory parameter of type Dataplat.Dbatools.Discovery.DbaInstanceConfidenceLevel" { - $CommandUnderTest | Should -HaveParameter MinimumConfidence -Type Dataplat.Dbatools.Discovery.DbaInstanceConfidenceLevel -Mandatory:$false + It "Should have MinimumConfidence as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter MinimumConfidence } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Find-DbaLoginInGroup.Tests.ps1 b/tests/Find-DbaLoginInGroup.Tests.ps1 index d9915d8cd6..c933bcf732 100644 --- a/tests/Find-DbaLoginInGroup.Tests.ps1 +++ b/tests/Find-DbaLoginInGroup.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Find-DbaLoginInGroup" { $CommandUnderTest = Get-Command Find-DbaLoginInGroup } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String[] + $CommandUnderTest | Should -HaveParameter Login } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Find-DbaOrphanedFile.Tests.ps1 b/tests/Find-DbaOrphanedFile.Tests.ps1 index 594f297e9c..7d01284ddb 100644 --- a/tests/Find-DbaOrphanedFile.Tests.ps1 +++ b/tests/Find-DbaOrphanedFile.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Find-DbaOrphanedFile" { $CommandUnderTest = Get-Command Find-DbaOrphanedFile } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String[] + $CommandUnderTest | Should -HaveParameter Path } It "Should have FileType as a parameter" { - $CommandUnderTest | Should -HaveParameter FileType -Type System.String[] + $CommandUnderTest | Should -HaveParameter FileType } It "Should have LocalOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter LocalOnly -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter LocalOnly } It "Should have RemoteOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter RemoteOnly -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter RemoteOnly } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have Recurse as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Recurse -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Recurse } } diff --git a/tests/Find-DbaSimilarTable.Tests.ps1 b/tests/Find-DbaSimilarTable.Tests.ps1 index c0572947ca..8de3b6ca2f 100644 --- a/tests/Find-DbaSimilarTable.Tests.ps1 +++ b/tests/Find-DbaSimilarTable.Tests.ps1 @@ -5,35 +5,35 @@ Describe "Find-DbaSimilarTable" { BeforeAll { $CommandUnderTest = Get-Command Find-DbaSimilarTable } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have ExcludeDatabase as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + It "Should have ExcludeDatabase as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } - It "Should have SchemaName as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter SchemaName -Type System.String -Mandatory:$false + It "Should have SchemaName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SchemaName } - It "Should have TableName as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter TableName -Type System.String -Mandatory:$false + It "Should have TableName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter TableName } It "Should have ExcludeViews as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeViews -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeViews } It "Should have IncludeSystemDatabases as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemDatabases -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeSystemDatabases } - It "Should have MatchPercentThreshold as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter MatchPercentThreshold -Type System.Int32 -Mandatory:$false + It "Should have MatchPercentThreshold as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter MatchPercentThreshold } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Find-DbaStoredProcedure.Tests.ps1 b/tests/Find-DbaStoredProcedure.Tests.ps1 index 84fdc99ae1..d3e83cf3b2 100644 --- a/tests/Find-DbaStoredProcedure.Tests.ps1 +++ b/tests/Find-DbaStoredProcedure.Tests.ps1 @@ -12,28 +12,28 @@ Describe "Find-DbaStoredProcedure Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Find-DbaStoredProcedure } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Pattern as a parameter" { - $CommandUnderTest | Should -HaveParameter Pattern -Type System.String + $CommandUnderTest | Should -HaveParameter Pattern } It "Should have IncludeSystemObjects as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemObjects -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSystemObjects } It "Should have IncludeSystemDatabases as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemDatabases -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSystemDatabases } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Find-DbaTrigger.Tests.ps1 b/tests/Find-DbaTrigger.Tests.ps1 index 0305cb343e..28c4c1b184 100644 --- a/tests/Find-DbaTrigger.Tests.ps1 +++ b/tests/Find-DbaTrigger.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Find-DbaTrigger Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Find-DbaTrigger } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Pattern as a parameter" { - $CommandUnderTest | Should -HaveParameter Pattern -Type System.String + $CommandUnderTest | Should -HaveParameter Pattern } It "Should have TriggerLevel as a parameter" { - $CommandUnderTest | Should -HaveParameter TriggerLevel -Type System.String + $CommandUnderTest | Should -HaveParameter TriggerLevel } It "Should have IncludeSystemObjects as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemObjects -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSystemObjects } It "Should have IncludeSystemDatabases as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemDatabases -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSystemDatabases } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Find-DbaUserObject.Tests.ps1 b/tests/Find-DbaUserObject.Tests.ps1 index 35c76bf36e..ca3d9bee41 100644 --- a/tests/Find-DbaUserObject.Tests.ps1 +++ b/tests/Find-DbaUserObject.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Find-DbaUserObject" { $CommandUnderTest = Get-Command Find-DbaUserObject } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Pattern as a parameter" { - $CommandUnderTest | Should -HaveParameter Pattern -Type System.String + $CommandUnderTest | Should -HaveParameter Pattern } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Find-DbaView.Tests.ps1 b/tests/Find-DbaView.Tests.ps1 index f4c6ac770b..bedb6dc5fd 100644 --- a/tests/Find-DbaView.Tests.ps1 +++ b/tests/Find-DbaView.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Find-DbaView" { $CommandUnderTest = Get-Command Find-DbaView } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Pattern as a parameter" { - $CommandUnderTest | Should -HaveParameter Pattern -Type System.String + $CommandUnderTest | Should -HaveParameter Pattern } It "Should have IncludeSystemObjects as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemObjects -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSystemObjects } It "Should have IncludeSystemDatabases as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemDatabases -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSystemDatabases } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Format-DbaBackupInformation.Tests.ps1 b/tests/Format-DbaBackupInformation.Tests.ps1 index 3a4389553b..ce474f5655 100644 --- a/tests/Format-DbaBackupInformation.Tests.ps1 +++ b/tests/Format-DbaBackupInformation.Tests.ps1 @@ -12,46 +12,46 @@ Describe "Format-DbaBackupInformation" { $CommandUnderTest = Get-Command Format-DbaBackupInformation } It "Should have BackupHistory as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupHistory -Type System.Object[] + $CommandUnderTest | Should -HaveParameter BackupHistory } It "Should have ReplaceDatabaseName as a parameter" { - $CommandUnderTest | Should -HaveParameter ReplaceDatabaseName -Type System.Object + $CommandUnderTest | Should -HaveParameter ReplaceDatabaseName } It "Should have ReplaceDbNameInFile as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ReplaceDbNameInFile -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ReplaceDbNameInFile } It "Should have DataFileDirectory as a parameter" { - $CommandUnderTest | Should -HaveParameter DataFileDirectory -Type System.String + $CommandUnderTest | Should -HaveParameter DataFileDirectory } It "Should have LogFileDirectory as a parameter" { - $CommandUnderTest | Should -HaveParameter LogFileDirectory -Type System.String + $CommandUnderTest | Should -HaveParameter LogFileDirectory } It "Should have DestinationFileStreamDirectory as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationFileStreamDirectory -Type System.String + $CommandUnderTest | Should -HaveParameter DestinationFileStreamDirectory } It "Should have DatabaseNamePrefix as a parameter" { - $CommandUnderTest | Should -HaveParameter DatabaseNamePrefix -Type System.String + $CommandUnderTest | Should -HaveParameter DatabaseNamePrefix } It "Should have DatabaseFilePrefix as a parameter" { - $CommandUnderTest | Should -HaveParameter DatabaseFilePrefix -Type System.String + $CommandUnderTest | Should -HaveParameter DatabaseFilePrefix } It "Should have DatabaseFileSuffix as a parameter" { - $CommandUnderTest | Should -HaveParameter DatabaseFileSuffix -Type System.String + $CommandUnderTest | Should -HaveParameter DatabaseFileSuffix } It "Should have RebaseBackupFolder as a parameter" { - $CommandUnderTest | Should -HaveParameter RebaseBackupFolder -Type System.String + $CommandUnderTest | Should -HaveParameter RebaseBackupFolder } It "Should have Continue as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Continue -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Continue } It "Should have FileMapping as a parameter" { - $CommandUnderTest | Should -HaveParameter FileMapping -Type System.Collections.Hashtable + $CommandUnderTest | Should -HaveParameter FileMapping } It "Should have PathSep as a parameter" { - $CommandUnderTest | Should -HaveParameter PathSep -Type System.String + $CommandUnderTest | Should -HaveParameter PathSep } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaAgBackupHistory.Tests.ps1 b/tests/Get-DbaAgBackupHistory.Tests.ps1 index 79c25ca5f8..62fba75ea8 100644 --- a/tests/Get-DbaAgBackupHistory.Tests.ps1 +++ b/tests/Get-DbaAgBackupHistory.Tests.ps1 @@ -5,65 +5,65 @@ Describe "Get-DbaAgBackupHistory" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaAgBackupHistory } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.SqlServer.Management.Smo.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have AvailabilityGroup as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String -Mandatory:$false + It "Should have AvailabilityGroup as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } - It "Should have Database as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have ExcludeDatabase as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] -Mandatory:$false + It "Should have ExcludeDatabase as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have IncludeCopyOnly as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeCopyOnly -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeCopyOnly } It "Should have Force as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } - It "Should have Since as a non-mandatory parameter of type System.DateTime" { - $CommandUnderTest | Should -HaveParameter Since -Type System.DateTime -Mandatory:$false + It "Should have Since as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Since } - It "Should have RecoveryFork as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter RecoveryFork -Type System.String -Mandatory:$false + It "Should have RecoveryFork as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter RecoveryFork } It "Should have Last as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Last -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Last } It "Should have LastFull as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter LastFull -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LastFull } It "Should have LastDiff as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter LastDiff -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LastDiff } It "Should have LastLog as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter LastLog -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LastLog } - It "Should have DeviceType as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter DeviceType -Type System.String[] -Mandatory:$false + It "Should have DeviceType as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter DeviceType } It "Should have Raw as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Raw -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Raw } - It "Should have LastLsn as a non-mandatory parameter of type System.Int64" { - $CommandUnderTest | Should -HaveParameter LastLsn -Type System.Int64 -Mandatory:$false + It "Should have LastLsn as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter LastLsn } It "Should have IncludeMirror as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeMirror -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeMirror } - It "Should have Type as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] -Mandatory:$false + It "Should have Type as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Type } - It "Should have LsnSort as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter LsnSort -Type System.String -Mandatory:$false + It "Should have LsnSort as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter LsnSort } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaAgDatabase.Tests.ps1 b/tests/Get-DbaAgDatabase.Tests.ps1 index f17189fd66..9c33835eea 100644 --- a/tests/Get-DbaAgDatabase.Tests.ps1 +++ b/tests/Get-DbaAgDatabase.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaAgDatabase" { $CommandUnderTest = Get-Command Get-DbaAgDatabase } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityGroup[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaAgHadr.Tests.ps1 b/tests/Get-DbaAgHadr.Tests.ps1 index e273345273..67cb601371 100644 --- a/tests/Get-DbaAgHadr.Tests.ps1 +++ b/tests/Get-DbaAgHadr.Tests.ps1 @@ -10,13 +10,13 @@ Describe "Get-DbaAgHadr" { $CommandUnderTest = Get-Command Get-DbaAgHadr } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaAgListener.Tests.ps1 b/tests/Get-DbaAgListener.Tests.ps1 index c952d98455..78a65e272e 100644 --- a/tests/Get-DbaAgListener.Tests.ps1 +++ b/tests/Get-DbaAgListener.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Get-DbaAgListener Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaAgListener } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String[] + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have Listener as a parameter" { - $CommandUnderTest | Should -HaveParameter Listener -Type String[] + $CommandUnderTest | Should -HaveParameter Listener } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityGroup[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch + $CommandUnderTest | Should -HaveParameter EnableException } } } @@ -40,14 +40,14 @@ Describe "Get-DbaAgListener Integration Tests" -Tag "IntegrationTests" { BeforeAll { if (-not $SkipIntegrationTests) { $agname = "dbatoolsci_ag_listener" - $ag = New-DbaAvailabilityGroup -Primary $global:instance3 -Name $agname -ClusterType None -FailoverMode Manual -Certificate dbatoolsci_AGCert -Confirm:$false - $ag | Add-DbaAgListener -IPAddress 127.0.20.1 -Port 14330 -Confirm:$false + $ag = New-DbaAvailabilityGroup -Primary $global:instance3 -Name $agname -ClusterType None -FailoverMode Manual -Certificate dbatoolsci_AGCert + $ag | Add-DbaAgListener -IPAddress 127.0.20.1 -Port 14330 } } AfterAll { if (-not $SkipIntegrationTests) { - $null = Remove-DbaAvailabilityGroup -SqlInstance $global:instance3 -AvailabilityGroup $agname -Confirm:$false + $null = Remove-DbaAvailabilityGroup -SqlInstance $global:instance3 -AvailabilityGroup $agname } } diff --git a/tests/Get-DbaAgReplica.Tests.ps1 b/tests/Get-DbaAgReplica.Tests.ps1 index d0eadcd3c5..5afab26d1c 100644 --- a/tests/Get-DbaAgReplica.Tests.ps1 +++ b/tests/Get-DbaAgReplica.Tests.ps1 @@ -11,22 +11,22 @@ Describe "Get-DbaAgReplica" { $CommandUnderTest = Get-Command Get-DbaAgReplica } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have Replica as a parameter" { - $CommandUnderTest | Should -HaveParameter Replica -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Replica } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityGroup[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaAgentAlert.Tests.ps1 b/tests/Get-DbaAgentAlert.Tests.ps1 index 21ee57210c..253563e5cb 100644 --- a/tests/Get-DbaAgentAlert.Tests.ps1 +++ b/tests/Get-DbaAgentAlert.Tests.ps1 @@ -11,19 +11,19 @@ Describe "Get-DbaAgentAlert Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaAgentAlert } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Alert as a parameter" { - $CommandUnderTest | Should -HaveParameter Alert -Type System.String[] + $CommandUnderTest | Should -HaveParameter Alert } It "Should have ExcludeAlert as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeAlert -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeAlert } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaAgentAlertCategory.Tests.ps1 b/tests/Get-DbaAgentAlertCategory.Tests.ps1 index 67c3cf2785..39427b97ac 100644 --- a/tests/Get-DbaAgentAlertCategory.Tests.ps1 +++ b/tests/Get-DbaAgentAlertCategory.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Get-DbaAgentAlertCategory" { $CommandUnderTest = Get-Command Get-DbaAgentAlertCategory } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Category as a parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type System.String[] + $CommandUnderTest | Should -HaveParameter Category } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaAgentJob.Tests.ps1 b/tests/Get-DbaAgentJob.Tests.ps1 index 5a5287b6d6..293bafc0b1 100644 --- a/tests/Get-DbaAgentJob.Tests.ps1 +++ b/tests/Get-DbaAgentJob.Tests.ps1 @@ -12,37 +12,37 @@ Describe "Get-DbaAgentJob Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaAgentJob } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Job parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Job } It "Should have ExcludeJob parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeJob -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeJob } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Category parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Category } It "Should have ExcludeCategory parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeCategory -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeCategory } It "Should have ExcludeDisabledJobs parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDisabledJobs -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDisabledJobs } It "Should have IncludeExecution parameter" { - $CommandUnderTest | Should -HaveParameter IncludeExecution -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeExecution } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaAgentJobCategory.Tests.ps1 b/tests/Get-DbaAgentJobCategory.Tests.ps1 index 03cbc6985b..440fe9fecf 100644 --- a/tests/Get-DbaAgentJobCategory.Tests.ps1 +++ b/tests/Get-DbaAgentJobCategory.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Get-DbaAgentJobCategory" { $CommandUnderTest = Get-Command Get-DbaAgentJobCategory } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Category as a parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type System.String[] + $CommandUnderTest | Should -HaveParameter Category } It "Should have CategoryType as a parameter" { - $CommandUnderTest | Should -HaveParameter CategoryType -Type System.String + $CommandUnderTest | Should -HaveParameter CategoryType } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaAgentJobHistory.Tests.ps1 b/tests/Get-DbaAgentJobHistory.Tests.ps1 index c39dc80437..6509fa3923 100644 --- a/tests/Get-DbaAgentJobHistory.Tests.ps1 +++ b/tests/Get-DbaAgentJobHistory.Tests.ps1 @@ -12,37 +12,37 @@ Describe "Get-DbaAgentJobHistory Unit Tests" -Tag 'UnitTests' { $command = Get-Command -Name $CommandName } It "Should have SqlInstance parameter" { - $command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $command | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $command | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $command | Should -HaveParameter SqlCredential } It "Should have Job parameter" { - $command | Should -HaveParameter Job -Type System.Object[] -Mandatory:$false + $command | Should -HaveParameter Job } It "Should have ExcludeJob parameter" { - $command | Should -HaveParameter ExcludeJob -Type System.Object[] -Mandatory:$false + $command | Should -HaveParameter ExcludeJob } It "Should have StartDate parameter" { - $command | Should -HaveParameter StartDate -Type System.DateTime -Mandatory:$false + $command | Should -HaveParameter StartDate } It "Should have EndDate parameter" { - $command | Should -HaveParameter EndDate -Type System.DateTime -Mandatory:$false + $command | Should -HaveParameter EndDate } It "Should have OutcomeType parameter" { - $command | Should -HaveParameter OutcomeType -Type Microsoft.SqlServer.Management.Smo.Agent.CompletionResult -Mandatory:$false + $command | Should -HaveParameter OutcomeType } It "Should have ExcludeJobSteps parameter" { - $command | Should -HaveParameter ExcludeJobSteps -Type System.Management.Automation.Switch -Mandatory:$false + $command | Should -HaveParameter ExcludeJobSteps } It "Should have WithOutputFile parameter" { - $command | Should -HaveParameter WithOutputFile -Type System.Management.Automation.Switch -Mandatory:$false + $command | Should -HaveParameter WithOutputFile } It "Should have JobCollection parameter" { - $command | Should -HaveParameter JobCollection -Type Microsoft.SqlServer.Management.Smo.Agent.Job -Mandatory:$false + $command | Should -HaveParameter JobCollection } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $command | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaAgentJobOutputFile.Tests.ps1 b/tests/Get-DbaAgentJobOutputFile.Tests.ps1 index 162eb1fe13..e77c01e880 100644 --- a/tests/Get-DbaAgentJobOutputFile.Tests.ps1 +++ b/tests/Get-DbaAgentJobOutputFile.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Get-DbaAgentJobOutputFile" { $CommandUnderTest = Get-Command Get-DbaAgentJobOutputFile } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Job parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Job } It "Should have ExcludeJob parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeJob -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeJob } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaAgentJobStep.Tests.ps1 b/tests/Get-DbaAgentJobStep.Tests.ps1 index b66b19402d..cb4ca194ea 100644 --- a/tests/Get-DbaAgentJobStep.Tests.ps1 +++ b/tests/Get-DbaAgentJobStep.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Get-DbaAgentJobStep" { $CommandUnderTest = Get-Command Get-DbaAgentJobStep } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Job as a parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.String[] + $CommandUnderTest | Should -HaveParameter Job } It "Should have ExcludeJob as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeJob -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeJob } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Agent.Job[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have ExcludeDisabledJobs as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDisabledJobs -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeDisabledJobs } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaAgentLog.Tests.ps1 b/tests/Get-DbaAgentLog.Tests.ps1 index e6e2fe087e..ffeb042f62 100644 --- a/tests/Get-DbaAgentLog.Tests.ps1 +++ b/tests/Get-DbaAgentLog.Tests.ps1 @@ -10,16 +10,16 @@ Describe "Get-DbaAgentLog" { $CommandUnderTest = Get-Command Get-DbaAgentLog } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have LogNumber as a parameter" { - $CommandUnderTest | Should -HaveParameter LogNumber -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter LogNumber } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaAgentOperator.Tests.ps1 b/tests/Get-DbaAgentOperator.Tests.ps1 index 0ff89a1963..9f084644a5 100644 --- a/tests/Get-DbaAgentOperator.Tests.ps1 +++ b/tests/Get-DbaAgentOperator.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Get-DbaAgentOperator" { $CommandUnderTest = Get-Command Get-DbaAgentOperator } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Operator as a parameter" { - $CommandUnderTest | Should -HaveParameter Operator -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Operator } It "Should have ExcludeOperator as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeOperator -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeOperator } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaAgentProxy.Tests.ps1 b/tests/Get-DbaAgentProxy.Tests.ps1 index 84ca40df1d..a7cc511d9a 100644 --- a/tests/Get-DbaAgentProxy.Tests.ps1 +++ b/tests/Get-DbaAgentProxy.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Get-DbaAgentProxy" { $CommandUnderTest = Get-Command Get-DbaAgentProxy } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Proxy as a parameter" { - $CommandUnderTest | Should -HaveParameter Proxy -Type System.String[] + $CommandUnderTest | Should -HaveParameter Proxy } It "Should have ExcludeProxy as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeProxy -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeProxy } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -30,7 +30,7 @@ Describe "Get-DbaAgentProxy" { BeforeAll { $tPassword = ConvertTo-SecureString "ThisIsThePassword1" -AsPlainText -Force $tUserName = "dbatoolsci_proxytest" - New-LocalUser -Name $tUserName -Password $tPassword -Disabled:$false + New-LocalUser -Name $tUserName -Password $tPassword New-DbaCredential -SqlInstance $global:instance2 -Name "$tUserName" -Identity "$env:COMPUTERNAME\$tUserName" -Password $tPassword New-DbaAgentProxy -SqlInstance $global:instance2 -Name STIG -ProxyCredential "$tUserName" New-DbaAgentProxy -SqlInstance $global:instance2 -Name STIGX -ProxyCredential "$tUserName" diff --git a/tests/Get-DbaAgentSchedule.Tests.ps1 b/tests/Get-DbaAgentSchedule.Tests.ps1 index 41ef674430..05714cfc1a 100644 --- a/tests/Get-DbaAgentSchedule.Tests.ps1 +++ b/tests/Get-DbaAgentSchedule.Tests.ps1 @@ -10,12 +10,12 @@ Describe "Get-DbaAgentSchedule Unit Tests" -Tag 'UnitTests' { $CommandName = Get-Command Get-DbaAgentSchedule } It "Should have the correct parameters" { - $CommandName | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false - $CommandName | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false - $CommandName | Should -HaveParameter Schedule -Type System.String[] -Mandatory:$false - $CommandName | Should -HaveParameter ScheduleUid -Type System.String[] -Mandatory:$false - $CommandName | Should -HaveParameter Id -Type System.Int32[] -Mandatory:$false - $CommandName | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandName | Should -HaveParameter SqlInstance + $CommandName | Should -HaveParameter SqlCredential + $CommandName | Should -HaveParameter Schedule + $CommandName | Should -HaveParameter ScheduleUid + $CommandName | Should -HaveParameter Id + $CommandName | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaAgentServer.Tests.ps1 b/tests/Get-DbaAgentServer.Tests.ps1 index 0688c9a25f..b3fd1ef00b 100644 --- a/tests/Get-DbaAgentServer.Tests.ps1 +++ b/tests/Get-DbaAgentServer.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbaAgentServer" { $CommandUnderTest = Get-Command Get-DbaAgentServer } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaAvailabilityGroup.Tests.ps1 b/tests/Get-DbaAvailabilityGroup.Tests.ps1 index d06f0d19ef..527b1652dc 100644 --- a/tests/Get-DbaAvailabilityGroup.Tests.ps1 +++ b/tests/Get-DbaAvailabilityGroup.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Get-DbaAvailabilityGroup" { $CommandUnderTest = Get-Command Get-DbaAvailabilityGroup } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String[] + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have IsPrimary as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IsPrimary -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IsPrimary } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaAvailableCollation.Tests.ps1 b/tests/Get-DbaAvailableCollation.Tests.ps1 index 4888a53616..dcb5fb5c75 100644 --- a/tests/Get-DbaAvailableCollation.Tests.ps1 +++ b/tests/Get-DbaAvailableCollation.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaAvailableCollation" { $CommandUnderTest = Get-Command Get-DbaAvailableCollation } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaBackupDevice.Tests.ps1 b/tests/Get-DbaBackupDevice.Tests.ps1 index 3aa3b646d7..f702218f22 100644 --- a/tests/Get-DbaBackupDevice.Tests.ps1 +++ b/tests/Get-DbaBackupDevice.Tests.ps1 @@ -5,14 +5,14 @@ Describe "Get-DbaBackupDevice" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaBackupDevice } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaBackupInformation.Tests.ps1 b/tests/Get-DbaBackupInformation.Tests.ps1 index ae89e5c6bc..0a63edde59 100644 --- a/tests/Get-DbaBackupInformation.Tests.ps1 +++ b/tests/Get-DbaBackupInformation.Tests.ps1 @@ -59,58 +59,58 @@ Describe "Get-DbaBackupInformation" { $CommandUnderTest = Get-Command Get-DbaBackupInformation } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have DatabaseName parameter" { - $CommandUnderTest | Should -HaveParameter DatabaseName -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DatabaseName } It "Should have SourceInstance parameter" { - $CommandUnderTest | Should -HaveParameter SourceInstance -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SourceInstance } It "Should have NoXpDirTree parameter" { - $CommandUnderTest | Should -HaveParameter NoXpDirTree -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoXpDirTree } It "Should have NoXpDirRecurse parameter" { - $CommandUnderTest | Should -HaveParameter NoXpDirRecurse -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoXpDirRecurse } It "Should have DirectoryRecurse parameter" { - $CommandUnderTest | Should -HaveParameter DirectoryRecurse -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DirectoryRecurse } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have MaintenanceSolution parameter" { - $CommandUnderTest | Should -HaveParameter MaintenanceSolution -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaintenanceSolution } It "Should have IgnoreLogBackup parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreLogBackup -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IgnoreLogBackup } It "Should have IgnoreDiffBackup parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreDiffBackup -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IgnoreDiffBackup } It "Should have ExportPath parameter" { - $CommandUnderTest | Should -HaveParameter ExportPath -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExportPath } It "Should have AzureCredential parameter" { - $CommandUnderTest | Should -HaveParameter AzureCredential -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AzureCredential } It "Should have Import parameter" { - $CommandUnderTest | Should -HaveParameter Import -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Import } It "Should have Anonymise parameter" { - $CommandUnderTest | Should -HaveParameter Anonymise -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Anonymise } It "Should have NoClobber parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoClobber } It "Should have PassThru parameter" { - $CommandUnderTest | Should -HaveParameter PassThru -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PassThru } } diff --git a/tests/Get-DbaBinaryFileTable.Tests.ps1 b/tests/Get-DbaBinaryFileTable.Tests.ps1 index 11f3cc615d..b191b9c3b9 100644 --- a/tests/Get-DbaBinaryFileTable.Tests.ps1 +++ b/tests/Get-DbaBinaryFileTable.Tests.ps1 @@ -25,25 +25,25 @@ Describe "Get-DbaBinaryFileTable" { $CommandUnderTest = Get-Command Get-DbaBinaryFileTable } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Table as a parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] + $CommandUnderTest | Should -HaveParameter Table } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String[] + $CommandUnderTest | Should -HaveParameter Schema } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type [Microsoft.SqlServer.Management.Smo.Table[]] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaBuild.Tests.ps1 b/tests/Get-DbaBuild.Tests.ps1 index 678025e0f4..eb43611840 100644 --- a/tests/Get-DbaBuild.Tests.ps1 +++ b/tests/Get-DbaBuild.Tests.ps1 @@ -15,31 +15,31 @@ Describe "Get-DbaBuild" { $CommandUnderTest = Get-Command Get-DbaBuild } It "Should have Build parameter" { - $CommandUnderTest | Should -HaveParameter Build -Type System.Version[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Build } It "Should have Kb parameter" { - $CommandUnderTest | Should -HaveParameter Kb -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Kb } It "Should have MajorVersion parameter" { - $CommandUnderTest | Should -HaveParameter MajorVersion -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MajorVersion } It "Should have ServicePack parameter" { - $CommandUnderTest | Should -HaveParameter ServicePack -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ServicePack } It "Should have CumulativeUpdate parameter" { - $CommandUnderTest | Should -HaveParameter CumulativeUpdate -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CumulativeUpdate } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Update parameter" { - $CommandUnderTest | Should -HaveParameter Update -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Update } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaClientAlias.Tests.ps1 b/tests/Get-DbaClientAlias.Tests.ps1 index 8b1363e655..65abc092c0 100644 --- a/tests/Get-DbaClientAlias.Tests.ps1 +++ b/tests/Get-DbaClientAlias.Tests.ps1 @@ -5,14 +5,14 @@ Describe "Get-DbaClientAlias" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaClientAlias } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaClientProtocol.Tests.ps1 b/tests/Get-DbaClientProtocol.Tests.ps1 index 214fac3d6c..6e77c551ec 100644 --- a/tests/Get-DbaClientProtocol.Tests.ps1 +++ b/tests/Get-DbaClientProtocol.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbaClientProtocol" { $CommandUnderTest = Get-Command Get-DbaClientProtocol } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaCmConnection.Tests.ps1 b/tests/Get-DbaCmConnection.Tests.ps1 index cd532b8e6c..003177e74d 100644 --- a/tests/Get-DbaCmConnection.Tests.ps1 +++ b/tests/Get-DbaCmConnection.Tests.ps1 @@ -5,14 +5,14 @@ Describe "Get-DbaCmConnection" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaCmConnection } - It "Should have ComputerName as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type System.String[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have UserName as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter UserName -Type System.String -Mandatory:$false + It "Should have UserName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter UserName } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaCmObject.Tests.ps1 b/tests/Get-DbaCmObject.Tests.ps1 index f2c5c06809..7111cddf04 100644 --- a/tests/Get-DbaCmObject.Tests.ps1 +++ b/tests/Get-DbaCmObject.Tests.ps1 @@ -11,32 +11,32 @@ Describe "Get-DbaCmObject" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaCmObject } - It "Should have ClassName as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter ClassName -Type System.String -Mandatory:$false + It "Should have ClassName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ClassName } - It "Should have Query as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Query -Type System.String -Mandatory:$false + It "Should have Query as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Query } - It "Should have ComputerName as a non-mandatory Dataplat.Dbatools.Parameter.DbaCmConnectionParameter[] parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaCmConnectionParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory System.Management.Automation.PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } - It "Should have Namespace as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Namespace -Type System.String -Mandatory:$false + It "Should have Namespace as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Namespace } - It "Should have DoNotUse as a non-mandatory Dataplat.Dbatools.Connection.ManagementConnectionType[] parameter" { - $CommandUnderTest | Should -HaveParameter DoNotUse -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] -Mandatory:$false + It "Should have DoNotUse as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter DoNotUse } - It "Should have Force as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have Force as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Force } - It "Should have SilentlyContinue as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter SilentlyContinue -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have SilentlyContinue as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SilentlyContinue } - It "Should have EnableException as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have EnableException as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaComputerCertificate.Tests.ps1 b/tests/Get-DbaComputerCertificate.Tests.ps1 index 6dc4bed9ca..aac22238c4 100644 --- a/tests/Get-DbaComputerCertificate.Tests.ps1 +++ b/tests/Get-DbaComputerCertificate.Tests.ps1 @@ -11,28 +11,28 @@ Describe "Get-DbaComputerCertificate" { $CommandUnderTest = Get-Command Get-DbaComputerCertificate } It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Store as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Store -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Store } It "Should have Folder as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Folder -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Folder } It "Should have Type as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type } It "Should have Path as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have Thumbprint as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Thumbprint -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Thumbprint } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaComputerSystem.Tests.ps1 b/tests/Get-DbaComputerSystem.Tests.ps1 index 81a4d8bdd7..5cd399d971 100644 --- a/tests/Get-DbaComputerSystem.Tests.ps1 +++ b/tests/Get-DbaComputerSystem.Tests.ps1 @@ -10,16 +10,16 @@ Describe "Get-DbaComputerSystem" { $CommandUnderTest = Get-Command Get-DbaComputerSystem } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have IncludeAws as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeAws -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeAws } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaConnection.Tests.ps1 b/tests/Get-DbaConnection.Tests.ps1 index 62124d3a42..b9c140aa98 100644 --- a/tests/Get-DbaConnection.Tests.ps1 +++ b/tests/Get-DbaConnection.Tests.ps1 @@ -9,14 +9,14 @@ Describe "Get-DbaConnection" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaConnection } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaCpuRingBuffer.Tests.ps1 b/tests/Get-DbaCpuRingBuffer.Tests.ps1 index 4bae0ad71e..a2b5d697f1 100644 --- a/tests/Get-DbaCpuRingBuffer.Tests.ps1 +++ b/tests/Get-DbaCpuRingBuffer.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Get-DbaCpuRingBuffer" { $CommandUnderTest = Get-Command Get-DbaCpuRingBuffer } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Microsoft.SqlServer.Management.Smo.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have CollectionMinutes as a parameter" { - $CommandUnderTest | Should -HaveParameter CollectionMinutes -Type System.Int32 + $CommandUnderTest | Should -HaveParameter CollectionMinutes } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaCpuUsage.Tests.ps1 b/tests/Get-DbaCpuUsage.Tests.ps1 index 938956d91f..304c9f3233 100644 --- a/tests/Get-DbaCpuUsage.Tests.ps1 +++ b/tests/Get-DbaCpuUsage.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Get-DbaCpuUsage" { $CommandUnderTest = Get-Command Get-DbaCpuUsage } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Threshold as a parameter" { - $CommandUnderTest | Should -HaveParameter Threshold -Type System.Int32 + $CommandUnderTest | Should -HaveParameter Threshold } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaCredential.Tests.ps1 b/tests/Get-DbaCredential.Tests.ps1 index 287c81d1bf..071a24ab1f 100644 --- a/tests/Get-DbaCredential.Tests.ps1 +++ b/tests/Get-DbaCredential.Tests.ps1 @@ -36,25 +36,25 @@ Describe "Get-DbaCredential" { $CommandUnderTest = Get-Command Get-DbaCredential } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.String[] + $CommandUnderTest | Should -HaveParameter Credential } It "Should have ExcludeCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeCredential -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeCredential } It "Should have Identity as a parameter" { - $CommandUnderTest | Should -HaveParameter Identity -Type System.String[] + $CommandUnderTest | Should -HaveParameter Identity } It "Should have ExcludeIdentity as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeIdentity -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeIdentity } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaCustomError.Tests.ps1 b/tests/Get-DbaCustomError.Tests.ps1 index e1ab48d3c0..856b5d7caf 100644 --- a/tests/Get-DbaCustomError.Tests.ps1 +++ b/tests/Get-DbaCustomError.Tests.ps1 @@ -5,14 +5,14 @@ Describe "Get-DbaCustomError" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaCustomError } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDBFileGroup.Tests.ps1 b/tests/Get-DbaDBFileGroup.Tests.ps1 index d5ef1da270..54d9b6539a 100644 --- a/tests/Get-DbaDBFileGroup.Tests.ps1 +++ b/tests/Get-DbaDBFileGroup.Tests.ps1 @@ -23,22 +23,22 @@ Describe "Get-DbaDbFileGroup" { $CommandUnderTest = Get-Command Get-DbaDbFileGroup } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have FileGroup parameter" { - $CommandUnderTest | Should -HaveParameter FileGroup -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FileGroup } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDatabase.Tests.ps1 b/tests/Get-DbaDatabase.Tests.ps1 index 0b08982d33..973c1b1e29 100644 --- a/tests/Get-DbaDatabase.Tests.ps1 +++ b/tests/Get-DbaDatabase.Tests.ps1 @@ -5,59 +5,59 @@ Describe "Get-DbaDatabase" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaDatabase } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type Microsoft.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have ExcludeDatabase as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] -Mandatory:$false + It "Should have ExcludeDatabase as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have ExcludeUser as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeUser -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeUser } It "Should have ExcludeSystem as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystem -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeSystem } - It "Should have Owner as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Owner -Type System.String[] -Mandatory:$false + It "Should have Owner as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Owner } It "Should have Encrypted as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Encrypted -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Encrypted } - It "Should have Status as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Status -Type System.String[] -Mandatory:$false + It "Should have Status as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Status } - It "Should have Access as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Access -Type System.String -Mandatory:$false + It "Should have Access as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Access } - It "Should have RecoveryModel as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter RecoveryModel -Type System.String[] -Mandatory:$false + It "Should have RecoveryModel as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter RecoveryModel } It "Should have NoFullBackup as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter NoFullBackup -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoFullBackup } - It "Should have NoFullBackupSince as a non-mandatory parameter of type System.DateTime" { - $CommandUnderTest | Should -HaveParameter NoFullBackupSince -Type System.DateTime -Mandatory:$false + It "Should have NoFullBackupSince as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter NoFullBackupSince } It "Should have NoLogBackup as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter NoLogBackup -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoLogBackup } - It "Should have NoLogBackupSince as a non-mandatory parameter of type System.DateTime" { - $CommandUnderTest | Should -HaveParameter NoLogBackupSince -Type System.DateTime -Mandatory:$false + It "Should have NoLogBackupSince as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter NoLogBackupSince } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have IncludeLastUsed as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeLastUsed -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeLastUsed } It "Should have OnlyAccessible as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter OnlyAccessible -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OnlyAccessible } } diff --git a/tests/Get-DbaDbAssembly.Tests.ps1 b/tests/Get-DbaDbAssembly.Tests.ps1 index e6d262726f..82a39bcb7b 100644 --- a/tests/Get-DbaDbAssembly.Tests.ps1 +++ b/tests/Get-DbaDbAssembly.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Get-DbaDbAssembly" { $CommandUnderTest = Get-Command Get-DbaDbAssembly } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] + $CommandUnderTest | Should -HaveParameter Name } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbAsymmetricKey.Tests.ps1 b/tests/Get-DbaDbAsymmetricKey.Tests.ps1 index 81699cc8bb..4fca519a6a 100644 --- a/tests/Get-DbaDbAsymmetricKey.Tests.ps1 +++ b/tests/Get-DbaDbAsymmetricKey.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Get-DbaDbAsymmetricKey" { $CommandUnderTest = Get-Command Get-DbaDbAsymmetricKey } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] + $CommandUnderTest | Should -HaveParameter Name } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -38,7 +38,7 @@ Describe "Get-DbaDbAsymmetricKey" { $database = 'GetAsKey' $newDB = New-DbaDatabase -SqlInstance $global:instance2 -Name $database $tPassword = ConvertTo-SecureString "ThisIsThePassword1" -AsPlainText -Force - New-DbaDbMasterKey -SqlInstance $global:instance2 -Database $database -SecurePassword $tPassword -Confirm:$false + New-DbaDbMasterKey -SqlInstance $global:instance2 -Database $database -SecurePassword $tPassword New-DbaDbUser -SqlInstance $global:instance2 -Database $database -UserName $dbuser $null = New-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Database $database -Name $keyname -Owner keyowner -Algorithm $algorithm -WarningVariable warnvar } diff --git a/tests/Get-DbaDbBackupHistory.Tests.ps1 b/tests/Get-DbaDbBackupHistory.Tests.ps1 index b4da9ea0bf..f3dab260d7 100644 --- a/tests/Get-DbaDbBackupHistory.Tests.ps1 +++ b/tests/Get-DbaDbBackupHistory.Tests.ps1 @@ -6,67 +6,67 @@ Describe "Get-DbaDbBackupHistory Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaDbBackupHistory } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have IncludeCopyOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeCopyOnly -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeCopyOnly } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have Since as a parameter" { - $CommandUnderTest | Should -HaveParameter Since -Type PSObject -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Since } It "Should have RecoveryFork as a parameter" { - $CommandUnderTest | Should -HaveParameter RecoveryFork -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter RecoveryFork } It "Should have Last as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Last -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Last } It "Should have LastFull as a switch parameter" { - $CommandUnderTest | Should -HaveParameter LastFull -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LastFull } It "Should have LastDiff as a switch parameter" { - $CommandUnderTest | Should -HaveParameter LastDiff -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LastDiff } It "Should have LastLog as a switch parameter" { - $CommandUnderTest | Should -HaveParameter LastLog -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LastLog } It "Should have DeviceType as a parameter" { - $CommandUnderTest | Should -HaveParameter DeviceType -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DeviceType } It "Should have Raw as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Raw -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Raw } It "Should have LastLsn as a parameter" { - $CommandUnderTest | Should -HaveParameter LastLsn -Type System.Int64 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LastLsn } It "Should have IncludeMirror as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeMirror -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeMirror } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type } It "Should have AgCheck as a switch parameter" { - $CommandUnderTest | Should -HaveParameter AgCheck -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AgCheck } It "Should have IgnoreDiffBackup as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreDiffBackup -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IgnoreDiffBackup } It "Should have LsnSort as a parameter" { - $CommandUnderTest | Should -HaveParameter LsnSort -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LsnSort } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbCertificate.Tests.ps1 b/tests/Get-DbaDbCertificate.Tests.ps1 index 640dafc0f5..f78eaa8f4e 100644 --- a/tests/Get-DbaDbCertificate.Tests.ps1 +++ b/tests/Get-DbaDbCertificate.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Get-DbaDbCertificate" { $CommandUnderTest = Get-Command Get-DbaDbCertificate } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Certificate as a parameter" { - $CommandUnderTest | Should -HaveParameter Certificate -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Certificate } It "Should have Subject as a parameter" { - $CommandUnderTest | Should -HaveParameter Subject -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Subject } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbCheckConstraint.Tests.ps1 b/tests/Get-DbaDbCheckConstraint.Tests.ps1 index a1a511ede7..54b9d813f4 100644 --- a/tests/Get-DbaDbCheckConstraint.Tests.ps1 +++ b/tests/Get-DbaDbCheckConstraint.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaDbCheckConstraint Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaDbCheckConstraint } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have ExcludeSystemTable as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemTable -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeSystemTable } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbCompatibility.Tests.ps1 b/tests/Get-DbaDbCompatibility.Tests.ps1 index 64a14f76d4..2caab6d140 100644 --- a/tests/Get-DbaDbCompatibility.Tests.ps1 +++ b/tests/Get-DbaDbCompatibility.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Get-DbaDbCompatibility" { $CommandUnderTest = Get-Command Get-DbaDbCompatibility } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbCompression.Tests.ps1 b/tests/Get-DbaDbCompression.Tests.ps1 index ee65f1494c..f1c0c6f174 100644 --- a/tests/Get-DbaDbCompression.Tests.ps1 +++ b/tests/Get-DbaDbCompression.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaDbCompression" { $CommandUnderTest = Get-Command Get-DbaDbCompression } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Table as a parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Table } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbDbccOpenTran.Tests.ps1 b/tests/Get-DbaDbDbccOpenTran.Tests.ps1 index e6befb45dc..410437cf38 100644 --- a/tests/Get-DbaDbDbccOpenTran.Tests.ps1 +++ b/tests/Get-DbaDbDbccOpenTran.Tests.ps1 @@ -10,16 +10,16 @@ Describe "Get-DbaDbDbccOpenTran" { $CommandUnderTest = Get-Command Get-DbaDbDbccOpenTran } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbDetachedFileInfo.Tests.ps1 b/tests/Get-DbaDbDetachedFileInfo.Tests.ps1 index 93ef473793..235f63491d 100644 --- a/tests/Get-DbaDbDetachedFileInfo.Tests.ps1 +++ b/tests/Get-DbaDbDetachedFileInfo.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Get-DbaDbDetachedFileInfo" { $CommandUnderTest = Get-Command Get-DbaDbDetachedFileInfo } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String[] + $CommandUnderTest | Should -HaveParameter Path } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbEncryption.Tests.ps1 b/tests/Get-DbaDbEncryption.Tests.ps1 index 297e06d19c..7e530e1a6d 100644 --- a/tests/Get-DbaDbEncryption.Tests.ps1 +++ b/tests/Get-DbaDbEncryption.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaDbEncryption" { $CommandUnderTest = Get-Command Get-DbaDbEncryption } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have IncludeSystemDBs as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemDBs -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSystemDBs } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbEncryptionKey.Tests.ps1 b/tests/Get-DbaDbEncryptionKey.Tests.ps1 index 51847d4f86..469698d918 100644 --- a/tests/Get-DbaDbEncryptionKey.Tests.ps1 +++ b/tests/Get-DbaDbEncryptionKey.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaDbEncryptionKey" { $CommandUnderTest = Get-Command Get-DbaDbEncryptionKey } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbExtentDiff.Tests.ps1 b/tests/Get-DbaDbExtentDiff.Tests.ps1 index 4a58c25f1d..71df996e20 100644 --- a/tests/Get-DbaDbExtentDiff.Tests.ps1 +++ b/tests/Get-DbaDbExtentDiff.Tests.ps1 @@ -12,7 +12,7 @@ Describe "Get-DbaDbExtentDiff" { } AfterAll { - Remove-DbaDatabase -SqlInstance $global:instance2 -Database $dbname -Confirm:$false + Remove-DbaDatabase -SqlInstance $global:instance2 -Database $dbname } Context "Validate parameters" { @@ -20,19 +20,19 @@ Describe "Get-DbaDbExtentDiff" { $CommandUnderTest = Get-Command Get-DbaDbExtentDiff } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbFeatureUsage.Tests.ps1 b/tests/Get-DbaDbFeatureUsage.Tests.ps1 index 20c9638a3d..cda964a047 100644 --- a/tests/Get-DbaDbFeatureUsage.Tests.ps1 +++ b/tests/Get-DbaDbFeatureUsage.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaDbFeatureUsage" { $CommandUnderTest = Get-Command Get-DbaDbFeatureUsage } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbFile.Tests.ps1 b/tests/Get-DbaDbFile.Tests.ps1 index 11439798b8..4836ac033f 100644 --- a/tests/Get-DbaDbFile.Tests.ps1 +++ b/tests/Get-DbaDbFile.Tests.ps1 @@ -12,25 +12,25 @@ Describe "Get-DbaDbFile" { $CommandUnderTest = Get-Command Get-DbaDbFile } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.SqlServer.Management.Smo.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have FileGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter FileGroup -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FileGroup } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbFileGrowth.Tests.ps1 b/tests/Get-DbaDbFileGrowth.Tests.ps1 index 5c7b24a4e1..a3118eef7a 100644 --- a/tests/Get-DbaDbFileGrowth.Tests.ps1 +++ b/tests/Get-DbaDbFileGrowth.Tests.ps1 @@ -10,19 +10,19 @@ Describe "Get-DbaDbFileGrowth" { $CommandUnderTest = Get-Command Get-DbaDbFileGrowth } It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbFileMapping.Tests.ps1 b/tests/Get-DbaDbFileMapping.Tests.ps1 index 5394b34837..989db87a40 100644 --- a/tests/Get-DbaDbFileMapping.Tests.ps1 +++ b/tests/Get-DbaDbFileMapping.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Get-DbaDbFileMapping" { $CommandUnderTest = Get-Command Get-DbaDbFileMapping } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbForeignKey.Tests.ps1 b/tests/Get-DbaDbForeignKey.Tests.ps1 index 740e1afa7b..f8dc52d747 100644 --- a/tests/Get-DbaDbForeignKey.Tests.ps1 +++ b/tests/Get-DbaDbForeignKey.Tests.ps1 @@ -11,22 +11,22 @@ Describe "Get-DbaDbForeignKey Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaDbForeignKey } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have ExcludeSystemTable parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemTable -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeSystemTable } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbIdentity.Tests.ps1 b/tests/Get-DbaDbIdentity.Tests.ps1 index 7fae456150..33038cf1e7 100644 --- a/tests/Get-DbaDbIdentity.Tests.ps1 +++ b/tests/Get-DbaDbIdentity.Tests.ps1 @@ -27,19 +27,19 @@ Describe "Get-DbaDbIdentity" { $CommandUnderTest = Get-Command Get-DbaDbIdentity } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Table as a parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] + $CommandUnderTest | Should -HaveParameter Table } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbLogShipError.Tests.ps1 b/tests/Get-DbaDbLogShipError.Tests.ps1 index 334d2cc5d1..66dcc5741b 100644 --- a/tests/Get-DbaDbLogShipError.Tests.ps1 +++ b/tests/Get-DbaDbLogShipError.Tests.ps1 @@ -10,34 +10,34 @@ Describe "Get-DbaDbLogShipError Unit Tests" -Tag 'UnitTests' { $CommandName = Get-Command Get-DbaDbLogShipError } It "Should have SqlInstance as a parameter" { - $CommandName | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandName | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandName | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandName | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandName | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandName | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandName | Should -HaveParameter ExcludeDatabase -Type System.String[] -Mandatory:$false + $CommandName | Should -HaveParameter ExcludeDatabase } It "Should have Action as a parameter" { - $CommandName | Should -HaveParameter Action -Type System.String[] -Mandatory:$false + $CommandName | Should -HaveParameter Action } It "Should have DateTimeFrom as a parameter" { - $CommandName | Should -HaveParameter DateTimeFrom -Type System.DateTime -Mandatory:$false + $CommandName | Should -HaveParameter DateTimeFrom } It "Should have DateTimeTo as a parameter" { - $CommandName | Should -HaveParameter DateTimeTo -Type System.DateTime -Mandatory:$false + $CommandName | Should -HaveParameter DateTimeTo } It "Should have Primary as a parameter" { - $CommandName | Should -HaveParameter Primary -Type System.Management.Automation.Switch -Mandatory:$false + $CommandName | Should -HaveParameter Primary } It "Should have Secondary as a parameter" { - $CommandName | Should -HaveParameter Secondary -Type System.Management.Automation.Switch -Mandatory:$false + $CommandName | Should -HaveParameter Secondary } It "Should have EnableException as a parameter" { - $CommandName | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandName | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbLogSpace.Tests.ps1 b/tests/Get-DbaDbLogSpace.Tests.ps1 index 3c0595c5f2..76128a3189 100644 --- a/tests/Get-DbaDbLogSpace.Tests.ps1 +++ b/tests/Get-DbaDbLogSpace.Tests.ps1 @@ -5,23 +5,23 @@ Describe "Get-DbaDbLogSpace" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaDbLogSpace } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance -Mandatory:$false } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential -Mandatory:$false } - It "Should have Database as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database -Mandatory:$false } - It "Should have ExcludeDatabase as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] -Mandatory:$false + It "Should have ExcludeDatabase as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Mandatory:$false } It "Should have ExcludeSystemDatabase as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemDatabase -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeSystemDatabase -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException -Mandatory:$false } } diff --git a/tests/Get-DbaDbMail.Tests.ps1 b/tests/Get-DbaDbMail.Tests.ps1 index d0ee2c5807..eb34eea6e4 100644 --- a/tests/Get-DbaDbMail.Tests.ps1 +++ b/tests/Get-DbaDbMail.Tests.ps1 @@ -5,14 +5,14 @@ Describe "Get-DbaDbMail" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaDbMail } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbMailAccount.Tests.ps1 b/tests/Get-DbaDbMailAccount.Tests.ps1 index b02a67ed1c..a5ba6f532f 100644 --- a/tests/Get-DbaDbMailAccount.Tests.ps1 +++ b/tests/Get-DbaDbMailAccount.Tests.ps1 @@ -5,23 +5,23 @@ Describe "Get-DbaDbMailAccount" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaDbMailAccount } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Account as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Account -Type System.String[] -Mandatory:$false + It "Should have Account as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Account } - It "Should have ExcludeAccount as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeAccount -Type System.String[] -Mandatory:$false + It "Should have ExcludeAccount as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeAccount } - It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Mail.SqlMail[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Mail.SqlMail[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbMailConfig.Tests.ps1 b/tests/Get-DbaDbMailConfig.Tests.ps1 index 1f1cf1b160..4f439cd0e7 100644 --- a/tests/Get-DbaDbMailConfig.Tests.ps1 +++ b/tests/Get-DbaDbMailConfig.Tests.ps1 @@ -5,20 +5,20 @@ Describe "Get-DbaDbMailConfig" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaDbMailConfig } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Name as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] -Mandatory:$false + It "Should have Name as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Name } - It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Mail.SqlMail[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Mail.SqlMail[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbMailHistory.Tests.ps1 b/tests/Get-DbaDbMailHistory.Tests.ps1 index 18000a7b02..f2703d28f3 100644 --- a/tests/Get-DbaDbMailHistory.Tests.ps1 +++ b/tests/Get-DbaDbMailHistory.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Get-DbaDbMailHistory" { $CommandUnderTest = Get-Command Get-DbaDbMailHistory } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.SqlServer.Management.Smo.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Since as a parameter" { - $CommandUnderTest | Should -HaveParameter Since -Type System.DateTime + $CommandUnderTest | Should -HaveParameter Since } It "Should have Status as a parameter" { - $CommandUnderTest | Should -HaveParameter Status -Type System.String + $CommandUnderTest | Should -HaveParameter Status } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbMailLog.Tests.ps1 b/tests/Get-DbaDbMailLog.Tests.ps1 index cf63c12a75..12eab9a859 100644 --- a/tests/Get-DbaDbMailLog.Tests.ps1 +++ b/tests/Get-DbaDbMailLog.Tests.ps1 @@ -14,9 +14,6 @@ Describe "Get-DbaDbMailLog" { It "Should have Since as a parameter" { $CommandUnderTest | Should -HaveParameter Since -Type System.DateTime } - It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] - } It "Should have EnableException as a parameter" { $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter } diff --git a/tests/Get-DbaDbMailProfile.Tests.ps1 b/tests/Get-DbaDbMailProfile.Tests.ps1 index 4236a351f7..b5984b0b5f 100644 --- a/tests/Get-DbaDbMailProfile.Tests.ps1 +++ b/tests/Get-DbaDbMailProfile.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Get-DbaDbMailProfile Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaDbMailProfile } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Profile as a parameter" { - $CommandUnderTest | Should -HaveParameter Profile -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Profile } It "Should have ExcludeProfile as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeProfile -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeProfile } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Mail.SqlMail[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbMailServer.Tests.ps1 b/tests/Get-DbaDbMailServer.Tests.ps1 index a55770ecba..f00127f51d 100644 --- a/tests/Get-DbaDbMailServer.Tests.ps1 +++ b/tests/Get-DbaDbMailServer.Tests.ps1 @@ -5,23 +5,23 @@ Describe "Get-DbaDbMailServer" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaDbMailServer } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Server as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Server -Type System.String[] -Mandatory:$false + It "Should have Server as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Server } - It "Should have Account as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Account -Type System.String[] -Mandatory:$false + It "Should have Account as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Account } - It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Mail.SqlMail[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Mail.SqlMail[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbMasterKey.Tests.ps1 b/tests/Get-DbaDbMasterKey.Tests.ps1 index d221ce0b38..5f489502cd 100644 --- a/tests/Get-DbaDbMasterKey.Tests.ps1 +++ b/tests/Get-DbaDbMasterKey.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Get-DbaDbMasterKey Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaDbMasterKey } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbMemoryUsage.Tests.ps1 b/tests/Get-DbaDbMemoryUsage.Tests.ps1 index 3512b3627e..ed17bef65b 100644 --- a/tests/Get-DbaDbMemoryUsage.Tests.ps1 +++ b/tests/Get-DbaDbMemoryUsage.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaDbMemoryUsage" { $CommandUnderTest = Get-Command Get-DbaDbMemoryUsage } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have IncludeSystemDb as a parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemDb -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSystemDb } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbMirror.Tests.ps1 b/tests/Get-DbaDbMirror.Tests.ps1 index bf23774fe8..49b1d4304f 100644 --- a/tests/Get-DbaDbMirror.Tests.ps1 +++ b/tests/Get-DbaDbMirror.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Get-DbaDbMirror" { $CommandUnderTest = Get-Command Get-DbaDbMirror } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbMirrorMonitor.Tests.ps1 b/tests/Get-DbaDbMirrorMonitor.Tests.ps1 index 119804047a..2f8e2ab1f8 100644 --- a/tests/Get-DbaDbMirrorMonitor.Tests.ps1 +++ b/tests/Get-DbaDbMirrorMonitor.Tests.ps1 @@ -12,25 +12,25 @@ Describe "Get-DbaDbMirrorMonitor" { $CommandUnderTest = Get-Command Get-DbaDbMirrorMonitor } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Update parameter" { - $CommandUnderTest | Should -HaveParameter Update -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Update } It "Should have LimitResults parameter" { - $CommandUnderTest | Should -HaveParameter LimitResults -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LimitResults } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbObjectTrigger.Tests.ps1 b/tests/Get-DbaDbObjectTrigger.Tests.ps1 index a68fcd7714..f1e4d95569 100644 --- a/tests/Get-DbaDbObjectTrigger.Tests.ps1 +++ b/tests/Get-DbaDbObjectTrigger.Tests.ps1 @@ -23,9 +23,6 @@ Describe "Get-DbaDbObjectTrigger Unit Tests" -Tag 'UnitTests' { It "Should have ExcludeDatabase as a parameter" { $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] } - It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String - } It "Should have InputObject as a parameter" { $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] } diff --git a/tests/Get-DbaDbOrphanUser.Tests.ps1 b/tests/Get-DbaDbOrphanUser.Tests.ps1 index 46232735a7..bfea2a2bef 100644 --- a/tests/Get-DbaDbOrphanUser.Tests.ps1 +++ b/tests/Get-DbaDbOrphanUser.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Get-DbaDbOrphanUser" { $CommandUnderTest = Get-Command Get-DbaDbOrphanUser } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -33,8 +33,8 @@ CREATE LOGIN [dbatoolsci_orphan3] WITH PASSWORD = N'password3', CHECK_EXPIRATION CREATE DATABASE dbatoolsci_orphan; '@ $server = Connect-DbaInstance -SqlInstance $global:instance1 - $null = Remove-DbaLogin -SqlInstance $server -Login dbatoolsci_orphan1, dbatoolsci_orphan2, dbatoolsci_orphan3 -Force -Confirm:$false - $null = Remove-DbaDatabase -SqlInstance $server -Database dbatoolsci_orphan -Confirm:$false + $null = Remove-DbaLogin -SqlInstance $server -Login dbatoolsci_orphan1, dbatoolsci_orphan2, dbatoolsci_orphan3 -Force + $null = Remove-DbaDatabase -SqlInstance $server -Database dbatoolsci_orphan $null = Invoke-DbaQuery -SqlInstance $server -Query $loginsq $usersq = @' CREATE USER [dbatoolsci_orphan1] FROM LOGIN [dbatoolsci_orphan1]; @@ -48,8 +48,8 @@ CREATE USER [dbatoolsci_orphan3] FROM LOGIN [dbatoolsci_orphan3]; AfterAll { $server = Connect-DbaInstance -SqlInstance $global:instance1 - $null = Remove-DbaLogin -SqlInstance $server -Login dbatoolsci_orphan1, dbatoolsci_orphan2, dbatoolsci_orphan3 -Force -Confirm:$false - $null = Remove-DbaDatabase -SqlInstance $server -Database dbatoolsci_orphan -Confirm:$false + $null = Remove-DbaLogin -SqlInstance $server -Login dbatoolsci_orphan1, dbatoolsci_orphan2, dbatoolsci_orphan3 -Force + $null = Remove-DbaDatabase -SqlInstance $server -Database dbatoolsci_orphan } It "Finds two orphans" { diff --git a/tests/Get-DbaDbPageInfo.Tests.ps1 b/tests/Get-DbaDbPageInfo.Tests.ps1 index 3e9804d183..5ed4d2fca2 100644 --- a/tests/Get-DbaDbPageInfo.Tests.ps1 +++ b/tests/Get-DbaDbPageInfo.Tests.ps1 @@ -5,26 +5,26 @@ Describe "Get-DbaDbPageInfo" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaDbPageInfo } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have Schema as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String[] -Mandatory:$false + It "Should have Schema as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Schema } - It "Should have Table as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] -Mandatory:$false + It "Should have Table as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Table } - It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbPartitionFunction.Tests.ps1 b/tests/Get-DbaDbPartitionFunction.Tests.ps1 index b4ad17e496..58dc2d4de8 100644 --- a/tests/Get-DbaDbPartitionFunction.Tests.ps1 +++ b/tests/Get-DbaDbPartitionFunction.Tests.ps1 @@ -5,23 +5,23 @@ Describe "Get-DbaDbPartitionFunction" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaDbPartitionFunction } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have ExcludeDatabase as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + It "Should have ExcludeDatabase as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } - It "Should have PartitionFunction as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter PartitionFunction -Type System.String[] -Mandatory:$false + It "Should have PartitionFunction as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter PartitionFunction } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbPartitionScheme.Tests.ps1 b/tests/Get-DbaDbPartitionScheme.Tests.ps1 index a4fba2556c..1674348976 100644 --- a/tests/Get-DbaDbPartitionScheme.Tests.ps1 +++ b/tests/Get-DbaDbPartitionScheme.Tests.ps1 @@ -5,23 +5,23 @@ Describe "Get-DbaDbPartitionScheme" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaDbPartitionScheme } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have ExcludeDatabase as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + It "Should have ExcludeDatabase as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } - It "Should have PartitionScheme as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter PartitionScheme -Type System.String[] -Mandatory:$false + It "Should have PartitionScheme as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter PartitionScheme } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbQueryStoreOption.Tests.ps1 b/tests/Get-DbaDbQueryStoreOption.Tests.ps1 index 948eae4e1c..ea09df5391 100644 --- a/tests/Get-DbaDbQueryStoreOption.Tests.ps1 +++ b/tests/Get-DbaDbQueryStoreOption.Tests.ps1 @@ -10,19 +10,19 @@ Describe "Get-DbaDbQueryStoreOption" { $CommandUnderTest = Get-Command Get-DbaDbQueryStoreOption } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbRecoveryModel.Tests.ps1 b/tests/Get-DbaDbRecoveryModel.Tests.ps1 index a843548739..e970f80ec3 100644 --- a/tests/Get-DbaDbRecoveryModel.Tests.ps1 +++ b/tests/Get-DbaDbRecoveryModel.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Get-DbaDbRecoveryModel" { $CommandUnderTest = Get-Command Get-DbaDbRecoveryModel } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have RecoveryModel as a parameter" { - $CommandUnderTest | Should -HaveParameter RecoveryModel -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter RecoveryModel } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbRestoreHistory.Tests.ps1 b/tests/Get-DbaDbRestoreHistory.Tests.ps1 index c69574ad84..a869dfaff9 100644 --- a/tests/Get-DbaDbRestoreHistory.Tests.ps1 +++ b/tests/Get-DbaDbRestoreHistory.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Get-DbaDbRestoreHistory Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaDbRestoreHistory } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Since as a parameter" { - $CommandUnderTest | Should -HaveParameter Since -Type System.DateTime + $CommandUnderTest | Should -HaveParameter Since } It "Should have RestoreType as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreType -Type System.String + $CommandUnderTest | Should -HaveParameter RestoreType } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have Last as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Last -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Last } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbRole.Tests.ps1 b/tests/Get-DbaDbRole.Tests.ps1 index 76776af09f..8c6b5ba70c 100644 --- a/tests/Get-DbaDbRole.Tests.ps1 +++ b/tests/Get-DbaDbRole.Tests.ps1 @@ -6,31 +6,31 @@ Describe "Get-DbaDbRole" { $CommandUnderTest = Get-Command Get-DbaDbRole } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Role parameter" { - $CommandUnderTest | Should -HaveParameter Role -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Role } It "Should have ExcludeRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeRole -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeRole } It "Should have ExcludeFixedRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeFixedRole -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeFixedRole } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbRoleMember.Tests.ps1 b/tests/Get-DbaDbRoleMember.Tests.ps1 index 639e69644e..35afe67701 100644 --- a/tests/Get-DbaDbRoleMember.Tests.ps1 +++ b/tests/Get-DbaDbRoleMember.Tests.ps1 @@ -6,34 +6,34 @@ Describe "Get-DbaDbRoleMember Unit Tests" -Tag "UnitTests" { $CommandUnderTest = Get-Command Get-DbaDbRoleMember } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Role as a parameter" { - $CommandUnderTest | Should -HaveParameter Role -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Role } It "Should have ExcludeRole as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeRole -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeRole } It "Should have ExcludeFixedRole as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeFixedRole -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeFixedRole } It "Should have IncludeSystemUser as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemUser -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeSystemUser } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbSchema.Tests.ps1 b/tests/Get-DbaDbSchema.Tests.ps1 index 9a3589f8be..82ed0f8330 100644 --- a/tests/Get-DbaDbSchema.Tests.ps1 +++ b/tests/Get-DbaDbSchema.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Get-DbaDbSchema Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaDbSchema } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String[] + $CommandUnderTest | Should -HaveParameter Schema } It "Should have SchemaOwner as a parameter" { - $CommandUnderTest | Should -HaveParameter SchemaOwner -Type System.String[] + $CommandUnderTest | Should -HaveParameter SchemaOwner } It "Should have IncludeSystemDatabases as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemDatabases -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSystemDatabases } It "Should have IncludeSystemSchemas as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemSchemas -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSystemSchemas } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } @@ -46,7 +46,7 @@ Describe "Get-DbaDbSchema Integration Tests" -Tag "IntegrationTests" { $random = Get-Random $server1 = Connect-DbaInstance -SqlInstance $global:instance1 $server2 = Connect-DbaInstance -SqlInstance $global:instance2 - $null = Get-DbaProcess -SqlInstance $server1, $server2 | Where-Object Program -match dbatools | Stop-DbaProcess -Confirm:$false + $null = Get-DbaProcess -SqlInstance $server1, $server2 | Where-Object Program -match dbatools | Stop-DbaProcess $newDbName = "dbatoolsci_newdb_$random" $newDbs = New-DbaDatabase -SqlInstance $server1, $server2 -Name $newDbName @@ -69,8 +69,8 @@ Describe "Get-DbaDbSchema Integration Tests" -Tag "IntegrationTests" { } AfterAll { - $null = $newDbs | Remove-DbaDatabase -Confirm:$false - $null = $logins | Remove-DbaLogin -Confirm:$false + $null = $newDbs | Remove-DbaDatabase + $null = $logins | Remove-DbaLogin } Context "commands work as expected" { diff --git a/tests/Get-DbaDbSequence.Tests.ps1 b/tests/Get-DbaDbSequence.Tests.ps1 index e58f8a885d..a256f7afc0 100644 --- a/tests/Get-DbaDbSequence.Tests.ps1 +++ b/tests/Get-DbaDbSequence.Tests.ps1 @@ -12,25 +12,25 @@ Describe "Get-DbaDbSequence Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaDbSequence } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Sequence as a parameter" { - $CommandUnderTest | Should -HaveParameter Sequence -Type System.String[] + $CommandUnderTest | Should -HaveParameter Sequence } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String[] + $CommandUnderTest | Should -HaveParameter Schema } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbServiceBrokerQueue.Tests.ps1 b/tests/Get-DbaDbServiceBrokerQueue.Tests.ps1 index 0a57cab619..e29bc9e861 100644 --- a/tests/Get-DbaDbServiceBrokerQueue.Tests.ps1 +++ b/tests/Get-DbaDbServiceBrokerQueue.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaDbServiceBrokerQueue" { $CommandUnderTest = Get-Command Get-DbaDbServiceBrokerQueue } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have ExcludeSystemQueue as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemQueue -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeSystemQueue } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbServiceBrokerService.Tests.ps1 b/tests/Get-DbaDbServiceBrokerService.Tests.ps1 index 1d121e3f85..0927ecf6b0 100644 --- a/tests/Get-DbaDbServiceBrokerService.Tests.ps1 +++ b/tests/Get-DbaDbServiceBrokerService.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaDbServiceBrokerService" { $CommandUnderTest = Get-Command Get-DbaDbServiceBrokerService } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have ExcludeSystemService as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemService -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeSystemService } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbSharePoint.Tests.ps1 b/tests/Get-DbaDbSharePoint.Tests.ps1 index a3e7eac3e6..84b3c7322f 100644 --- a/tests/Get-DbaDbSharePoint.Tests.ps1 +++ b/tests/Get-DbaDbSharePoint.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Get-DbaDbSharePoint" { $CommandUnderTest = Get-Command Get-DbaDbSharePoint } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have ConfigDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ConfigDatabase -Type String[] + $CommandUnderTest | Should -HaveParameter ConfigDatabase } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbSnapshot.Tests.ps1 b/tests/Get-DbaDbSnapshot.Tests.ps1 index 392d0b1ec8..454af26d4e 100644 --- a/tests/Get-DbaDbSnapshot.Tests.ps1 +++ b/tests/Get-DbaDbSnapshot.Tests.ps1 @@ -12,25 +12,25 @@ Describe "Get-DbaDbSnapshot Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaDbSnapshot } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Snapshot as a parameter" { - $CommandUnderTest | Should -HaveParameter Snapshot -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Snapshot } It "Should have ExcludeSnapshot as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSnapshot -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeSnapshot } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbSpace.Tests.ps1 b/tests/Get-DbaDbSpace.Tests.ps1 index 8a25b64166..f4ceba7e3f 100644 --- a/tests/Get-DbaDbSpace.Tests.ps1 +++ b/tests/Get-DbaDbSpace.Tests.ps1 @@ -11,25 +11,25 @@ Describe "Get-DbaDbSpace" { $CommandUnderTest = Get-Command Get-DbaDbSpace } It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have IncludeSystemDBs as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemDBs -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeSystemDBs } It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbState.Tests.ps1 b/tests/Get-DbaDbState.Tests.ps1 index c08813b355..b91215d725 100644 --- a/tests/Get-DbaDbState.Tests.ps1 +++ b/tests/Get-DbaDbState.Tests.ps1 @@ -10,19 +10,19 @@ Describe "Get-DbaDbState" { $CommandUnderTest = Get-Command Get-DbaDbState } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbStoredProcedure.Tests.ps1 b/tests/Get-DbaDbStoredProcedure.Tests.ps1 index 4d36449016..be5e30cce9 100644 --- a/tests/Get-DbaDbStoredProcedure.Tests.ps1 +++ b/tests/Get-DbaDbStoredProcedure.Tests.ps1 @@ -11,32 +11,32 @@ Describe "Get-DbaDbStoredProcedure Unit Tests" -Tag 'UnitTests' { BeforeAll { $CommandUnderTest = Get-Command Get-DbaDbStoredProcedure } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance -Mandatory:$false } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential -Mandatory:$false } - It "Should have Database as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database -Mandatory:$false } - It "Should have ExcludeDatabase as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + It "Should have ExcludeDatabase as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Mandatory:$false } It "Should have ExcludeSystemSp as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemSp -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeSystemSp -Mandatory:$false } - It "Should have Name as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] -Mandatory:$false + It "Should have Name as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Name -Mandatory:$false } - It "Should have Schema as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String[] -Mandatory:$false + It "Should have Schema as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Schema -Mandatory:$false } - It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException -Mandatory:$false } } } diff --git a/tests/Get-DbaDbSynonym.Tests.ps1 b/tests/Get-DbaDbSynonym.Tests.ps1 index 64c1d98ece..6972208053 100644 --- a/tests/Get-DbaDbSynonym.Tests.ps1 +++ b/tests/Get-DbaDbSynonym.Tests.ps1 @@ -6,34 +6,34 @@ Describe "Get-DbaDbSynonym Unit Tests" -Tag "UnitTests" { $CommandUnderTest = Get-Command Get-DbaDbSynonym } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.SqlServer.Management.Smo.Credential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type String[] + $CommandUnderTest | Should -HaveParameter Schema } It "Should have ExcludeSchema as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSchema -Type String[] + $CommandUnderTest | Should -HaveParameter ExcludeSchema } It "Should have Synonym as a parameter" { - $CommandUnderTest | Should -HaveParameter Synonym -Type String[] + $CommandUnderTest | Should -HaveParameter Synonym } It "Should have ExcludeSynonym as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSynonym -Type String[] + $CommandUnderTest | Should -HaveParameter ExcludeSynonym } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbTable.Tests.ps1 b/tests/Get-DbaDbTable.Tests.ps1 index d5cc35be1d..3e4b558876 100644 --- a/tests/Get-DbaDbTable.Tests.ps1 +++ b/tests/Get-DbaDbTable.Tests.ps1 @@ -22,31 +22,31 @@ Describe "Get-DbaDbTable" { $CommandUnderTest = Get-Command Get-DbaDbTable } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have IncludeSystemDBs as a parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemDBs -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSystemDBs } It "Should have Table as a parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] + $CommandUnderTest | Should -HaveParameter Table } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String[] + $CommandUnderTest | Should -HaveParameter Schema } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbTrigger.Tests.ps1 b/tests/Get-DbaDbTrigger.Tests.ps1 index 9bd01a1e7d..7a10eb44af 100644 --- a/tests/Get-DbaDbTrigger.Tests.ps1 +++ b/tests/Get-DbaDbTrigger.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaDbTrigger Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaDbTrigger } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbUdf.Tests.ps1 b/tests/Get-DbaDbUdf.Tests.ps1 index 9c0c9b6c29..965443d754 100644 --- a/tests/Get-DbaDbUdf.Tests.ps1 +++ b/tests/Get-DbaDbUdf.Tests.ps1 @@ -12,34 +12,34 @@ Describe "Get-DbaDbUdf Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaDbUdf } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have ExcludeSystemUdf as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemUdf -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeSystemUdf } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String[] + $CommandUnderTest | Should -HaveParameter Schema } It "Should have ExcludeSchema as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSchema -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeSchema } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] + $CommandUnderTest | Should -HaveParameter Name } It "Should have ExcludeName as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeName -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeName } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbUser.Tests.ps1 b/tests/Get-DbaDbUser.Tests.ps1 index 38bd92252e..b8bfb627b4 100644 --- a/tests/Get-DbaDbUser.Tests.ps1 +++ b/tests/Get-DbaDbUser.Tests.ps1 @@ -12,28 +12,28 @@ Describe "Get-DbaDbUser Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaDbUser } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have ExcludeSystemUser as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemUser -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeSystemUser } It "Should have User as a parameter" { - $CommandUnderTest | Should -HaveParameter User -Type System.String[] + $CommandUnderTest | Should -HaveParameter User } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String[] + $CommandUnderTest | Should -HaveParameter Login } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbUserDefinedTableType.Tests.ps1 b/tests/Get-DbaDbUserDefinedTableType.Tests.ps1 index f9ec39ea89..94a7e15b42 100644 --- a/tests/Get-DbaDbUserDefinedTableType.Tests.ps1 +++ b/tests/Get-DbaDbUserDefinedTableType.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaDbUserDefinedTableType" { $CommandUnderTest = Get-Command Get-DbaDbUserDefinedTableType } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] + $CommandUnderTest | Should -HaveParameter Type } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbView.Tests.ps1 b/tests/Get-DbaDbView.Tests.ps1 index 69edd8efd8..62796817e2 100644 --- a/tests/Get-DbaDbView.Tests.ps1 +++ b/tests/Get-DbaDbView.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Get-DbaDbView Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaDbView } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have ExcludeSystemView as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemView -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeSystemView } It "Should have View as a parameter" { - $CommandUnderTest | Should -HaveParameter View -Type System.String[] + $CommandUnderTest | Should -HaveParameter View } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String[] + $CommandUnderTest | Should -HaveParameter Schema } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbVirtualLogFile.Tests.ps1 b/tests/Get-DbaDbVirtualLogFile.Tests.ps1 index b1a3ca88bc..c059aafed1 100644 --- a/tests/Get-DbaDbVirtualLogFile.Tests.ps1 +++ b/tests/Get-DbaDbVirtualLogFile.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Get-DbaDbVirtualLogFile Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaDbVirtualLogFile } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have IncludeSystemDBs as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemDBs -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSystemDBs } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDbccHelp.Tests.ps1 b/tests/Get-DbaDbccHelp.Tests.ps1 index b92ef4474d..21cf02d02f 100644 --- a/tests/Get-DbaDbccHelp.Tests.ps1 +++ b/tests/Get-DbaDbccHelp.Tests.ps1 @@ -5,20 +5,20 @@ Describe "Get-DbaDbccHelp" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaDbccHelp } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Statement as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Statement -Type System.String -Mandatory:$false + It "Should have Statement as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Statement } It "Should have IncludeUndocumented as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeUndocumented -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeUndocumented } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbccMemoryStatus.Tests.ps1 b/tests/Get-DbaDbccMemoryStatus.Tests.ps1 index f4639099c7..c96443a3a8 100644 --- a/tests/Get-DbaDbccMemoryStatus.Tests.ps1 +++ b/tests/Get-DbaDbccMemoryStatus.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaDbccMemoryStatus" { $CommandUnderTest = Get-Command Get-DbaDbccMemoryStatus } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbccProcCache.Tests.ps1 b/tests/Get-DbaDbccProcCache.Tests.ps1 index f435d4ad21..57cc52b5c7 100644 --- a/tests/Get-DbaDbccProcCache.Tests.ps1 +++ b/tests/Get-DbaDbccProcCache.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaDbccProcCache" { $CommandUnderTest = Get-Command Get-DbaDbccProcCache } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbccSessionBuffer.Tests.ps1 b/tests/Get-DbaDbccSessionBuffer.Tests.ps1 index ee69d109dc..098dd46174 100644 --- a/tests/Get-DbaDbccSessionBuffer.Tests.ps1 +++ b/tests/Get-DbaDbccSessionBuffer.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Get-DbaDbccSessionBuffer" { $CommandUnderTest = Get-Command Get-DbaDbccSessionBuffer } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Operation parameter" { - $CommandUnderTest | Should -HaveParameter Operation -Type System.String + $CommandUnderTest | Should -HaveParameter Operation } It "Should have SessionId parameter" { - $CommandUnderTest | Should -HaveParameter SessionId -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter SessionId } It "Should have RequestId parameter" { - $CommandUnderTest | Should -HaveParameter RequestId -Type System.Int32 + $CommandUnderTest | Should -HaveParameter RequestId } It "Should have All parameter" { - $CommandUnderTest | Should -HaveParameter All -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter All } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbccStatistic.Tests.ps1 b/tests/Get-DbaDbccStatistic.Tests.ps1 index f42585b6e8..c9d6b79ca1 100644 --- a/tests/Get-DbaDbccStatistic.Tests.ps1 +++ b/tests/Get-DbaDbccStatistic.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Get-DbaDbccStatistic" { $CommandUnderTest = Get-Command Get-DbaDbccStatistic } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Object parameter" { - $CommandUnderTest | Should -HaveParameter Object -Type System.String + $CommandUnderTest | Should -HaveParameter Object } It "Should have Target parameter" { - $CommandUnderTest | Should -HaveParameter Target -Type System.String + $CommandUnderTest | Should -HaveParameter Target } It "Should have Option parameter" { - $CommandUnderTest | Should -HaveParameter Option -Type System.String + $CommandUnderTest | Should -HaveParameter Option } It "Should have NoInformationalMessages parameter" { - $CommandUnderTest | Should -HaveParameter NoInformationalMessages -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoInformationalMessages } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDbccUserOption.Tests.ps1 b/tests/Get-DbaDbccUserOption.Tests.ps1 index 0387efe19a..3836b809e6 100644 --- a/tests/Get-DbaDbccUserOption.Tests.ps1 +++ b/tests/Get-DbaDbccUserOption.Tests.ps1 @@ -9,17 +9,17 @@ Describe "Get-DbaDbccUserOption" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaDbccUserOption } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Option as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Option -Type System.String[] -Mandatory:$false + It "Should have Option as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Option } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDefaultPath.Tests.ps1 b/tests/Get-DbaDefaultPath.Tests.ps1 index 8fff2a23ff..687ed81374 100644 --- a/tests/Get-DbaDefaultPath.Tests.ps1 +++ b/tests/Get-DbaDefaultPath.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbaDefaultPath" { $CommandUnderTest = Get-Command Get-DbaDefaultPath } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDependency.Tests.ps1 b/tests/Get-DbaDependency.Tests.ps1 index 4ffbba88d7..e8bdc95761 100644 --- a/tests/Get-DbaDependency.Tests.ps1 +++ b/tests/Get-DbaDependency.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Get-DbaDependency Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaDependency } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have AllowSystemObjects as a parameter" { - $CommandUnderTest | Should -HaveParameter AllowSystemObjects -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AllowSystemObjects } It "Should have Parents as a parameter" { - $CommandUnderTest | Should -HaveParameter Parents -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Parents } It "Should have IncludeSelf as a parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSelf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeSelf } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaDeprecatedFeature.Tests.ps1 b/tests/Get-DbaDeprecatedFeature.Tests.ps1 index 7f0f333f50..1e9eb15607 100644 --- a/tests/Get-DbaDeprecatedFeature.Tests.ps1 +++ b/tests/Get-DbaDeprecatedFeature.Tests.ps1 @@ -9,14 +9,14 @@ Describe "Get-DbaDeprecatedFeature" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaDeprecatedFeature } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDiskSpace.Tests.ps1 b/tests/Get-DbaDiskSpace.Tests.ps1 index f51bae1a08..5a110b18e3 100644 --- a/tests/Get-DbaDiskSpace.Tests.ps1 +++ b/tests/Get-DbaDiskSpace.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Get-DbaDiskSpace" { $CommandUnderTest = Get-Command Get-DbaDiskSpace } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type Microsoft.SqlServer.Management.Smo.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Unit as a parameter" { - $CommandUnderTest | Should -HaveParameter Unit -Type System.String + $CommandUnderTest | Should -HaveParameter Unit } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.SqlServer.Management.Smo.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have ExcludeDrive as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDrive -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeDrive } It "Should have CheckFragmentation as a switch parameter" { - $CommandUnderTest | Should -HaveParameter CheckFragmentation -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter CheckFragmentation } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaDump.Tests.ps1 b/tests/Get-DbaDump.Tests.ps1 index c753e2e86a..c46e50923f 100644 --- a/tests/Get-DbaDump.Tests.ps1 +++ b/tests/Get-DbaDump.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaDump" { $CommandUnderTest = Get-Command Get-DbaDump } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaEndpoint.Tests.ps1 b/tests/Get-DbaEndpoint.Tests.ps1 index 5774ec2196..64851919de 100644 --- a/tests/Get-DbaEndpoint.Tests.ps1 +++ b/tests/Get-DbaEndpoint.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Get-DbaEndpoint" { $CommandUnderTest = Get-Command Get-DbaEndpoint } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Endpoint as a parameter" { - $CommandUnderTest | Should -HaveParameter Endpoint -Type System.String[] + $CommandUnderTest | Should -HaveParameter Endpoint } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] + $CommandUnderTest | Should -HaveParameter Type } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaErrorLog.Tests.ps1 b/tests/Get-DbaErrorLog.Tests.ps1 index bb38092451..9d3a4c13d4 100644 --- a/tests/Get-DbaErrorLog.Tests.ps1 +++ b/tests/Get-DbaErrorLog.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Get-DbaErrorLog" { $CommandUnderTest = Get-Command Get-DbaErrorLog } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have LogNumber as a parameter" { - $CommandUnderTest | Should -HaveParameter LogNumber -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter LogNumber } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Source } It "Should have Text as a parameter" { - $CommandUnderTest | Should -HaveParameter Text -Type System.String + $CommandUnderTest | Should -HaveParameter Text } It "Should have After as a parameter" { - $CommandUnderTest | Should -HaveParameter After -Type System.DateTime + $CommandUnderTest | Should -HaveParameter After } It "Should have Before as a parameter" { - $CommandUnderTest | Should -HaveParameter Before -Type System.DateTime + $CommandUnderTest | Should -HaveParameter Before } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaErrorLogConfig.Tests.ps1 b/tests/Get-DbaErrorLogConfig.Tests.ps1 index 0d6531059e..4d556df5d1 100644 --- a/tests/Get-DbaErrorLogConfig.Tests.ps1 +++ b/tests/Get-DbaErrorLogConfig.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbaErrorLogConfig" { $CommandUnderTest = Get-Command Get-DbaErrorLogConfig } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaEstimatedCompletionTime.Tests.ps1 b/tests/Get-DbaEstimatedCompletionTime.Tests.ps1 index 685917f17c..f7fae3e0a6 100644 --- a/tests/Get-DbaEstimatedCompletionTime.Tests.ps1 +++ b/tests/Get-DbaEstimatedCompletionTime.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Get-DbaEstimatedCompletionTime" { $CommandUnderTest = Get-Command Get-DbaEstimatedCompletionTime } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaExecutionPlan.Tests.ps1 b/tests/Get-DbaExecutionPlan.Tests.ps1 index b7032b6e53..263b732be1 100644 --- a/tests/Get-DbaExecutionPlan.Tests.ps1 +++ b/tests/Get-DbaExecutionPlan.Tests.ps1 @@ -6,31 +6,31 @@ Describe "Get-DbaExecutionPlan" { $CommandUnderTest = Get-Command Get-DbaExecutionPlan } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have SinceCreation as a parameter" { - $CommandUnderTest | Should -HaveParameter SinceCreation -Type System.DateTime + $CommandUnderTest | Should -HaveParameter SinceCreation } It "Should have SinceLastExecution as a parameter" { - $CommandUnderTest | Should -HaveParameter SinceLastExecution -Type System.DateTime + $CommandUnderTest | Should -HaveParameter SinceLastExecution } It "Should have ExcludeEmptyQueryPlan as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeEmptyQueryPlan -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeEmptyQueryPlan } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaExtendedProperty.Tests.ps1 b/tests/Get-DbaExtendedProperty.Tests.ps1 index 79b93b8ef1..a24777d4b1 100644 --- a/tests/Get-DbaExtendedProperty.Tests.ps1 +++ b/tests/Get-DbaExtendedProperty.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaExtendedProperty" { $CommandUnderTest = Get-Command Get-DbaExtendedProperty } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] + $CommandUnderTest | Should -HaveParameter Name } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -29,14 +29,14 @@ Describe "Get-DbaExtendedProperty" { BeforeAll { $random = Get-Random $server2 = Connect-DbaInstance -SqlInstance $global:instance2 - $null = Get-DbaProcess -SqlInstance $server2 | Where-Object Program -match dbatools | Stop-DbaProcess -Confirm:$false + $null = Get-DbaProcess -SqlInstance $server2 | Where-Object Program -match dbatools | Stop-DbaProcess $newDbName = "dbatoolsci_newdb_$random" $db = New-DbaDatabase -SqlInstance $server2 -Name $newDbName $db.Query("EXEC sys.sp_addextendedproperty @name=N'dbatoolz', @value=N'woo'") } AfterAll { - $null = $db | Remove-DbaDatabase -Confirm:$false + $null = $db | Remove-DbaDatabase } It "finds an extended property on an instance" { diff --git a/tests/Get-DbaExtendedProtection.Tests.ps1 b/tests/Get-DbaExtendedProtection.Tests.ps1 index fa360cdf2b..2f823d50ed 100644 --- a/tests/Get-DbaExtendedProtection.Tests.ps1 +++ b/tests/Get-DbaExtendedProtection.Tests.ps1 @@ -10,19 +10,19 @@ Describe "Get-DbaExtendedProtection" { $CommandUnderTest = Get-Command Get-DbaExtendedProtection } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Confirm } } diff --git a/tests/Get-DbaExternalProcess.Tests.ps1 b/tests/Get-DbaExternalProcess.Tests.ps1 index cb62e484c8..fdfcc9f21d 100644 --- a/tests/Get-DbaExternalProcess.Tests.ps1 +++ b/tests/Get-DbaExternalProcess.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaExternalProcess" { $CommandUnderTest = Get-Command Get-DbaExternalProcess } It "Accepts ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Accepts Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Accepts EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaFeature.Tests.ps1 b/tests/Get-DbaFeature.Tests.ps1 index 473134dd4a..d08c8bbe39 100644 --- a/tests/Get-DbaFeature.Tests.ps1 +++ b/tests/Get-DbaFeature.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaFeature" { $CommandUnderTest = Get-Command Get-DbaFeature } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaFile.Tests.ps1 b/tests/Get-DbaFile.Tests.ps1 index 2f82bc6c1b..f4c1c96520 100644 --- a/tests/Get-DbaFile.Tests.ps1 +++ b/tests/Get-DbaFile.Tests.ps1 @@ -5,23 +5,23 @@ Describe "Get-DbaFile" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaFile } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance -Mandatory:$false } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential -Mandatory:$false } - It "Should have Path as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String[] -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path -Mandatory:$false } - It "Should have FileType as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter FileType -Type System.String[] -Mandatory:$false + It "Should have FileType as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter FileType -Mandatory:$false } - It "Should have Depth as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter Depth -Type System.Int32 -Mandatory:$false + It "Should have Depth as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Depth -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException -Mandatory:$false } } diff --git a/tests/Get-DbaFilestream.Tests.ps1 b/tests/Get-DbaFilestream.Tests.ps1 index 4b3e68fb59..7cd3943c2d 100644 --- a/tests/Get-DbaFilestream.Tests.ps1 +++ b/tests/Get-DbaFilestream.Tests.ps1 @@ -11,17 +11,17 @@ Describe "Get-DbaFilestream" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaFilestream } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaFirewallRule.Tests.ps1 b/tests/Get-DbaFirewallRule.Tests.ps1 index 249171a12b..ed81457327 100644 --- a/tests/Get-DbaFirewallRule.Tests.ps1 +++ b/tests/Get-DbaFirewallRule.Tests.ps1 @@ -10,16 +10,16 @@ Describe "Get-DbaFirewallRule" { $CommandUnderTest = Get-Command Get-DbaFirewallRule } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] + $CommandUnderTest | Should -HaveParameter Type } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaForceNetworkEncryption.Tests.ps1 b/tests/Get-DbaForceNetworkEncryption.Tests.ps1 index 2f535aa8d6..dc237cf705 100644 --- a/tests/Get-DbaForceNetworkEncryption.Tests.ps1 +++ b/tests/Get-DbaForceNetworkEncryption.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaForceNetworkEncryption" { $CommandUnderTest = Get-Command Get-DbaForceNetworkEncryption } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaHelpIndex.Tests.ps1 b/tests/Get-DbaHelpIndex.Tests.ps1 index d1dc126f5e..d59795c7ea 100644 --- a/tests/Get-DbaHelpIndex.Tests.ps1 +++ b/tests/Get-DbaHelpIndex.Tests.ps1 @@ -13,37 +13,37 @@ Describe "Get-DbaHelpIndex Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaHelpIndex } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have ObjectName as a parameter" { - $CommandUnderTest | Should -HaveParameter ObjectName -Type System.String + $CommandUnderTest | Should -HaveParameter ObjectName } It "Should have IncludeStats as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeStats -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeStats } It "Should have IncludeDataTypes as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeDataTypes -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeDataTypes } It "Should have Raw as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Raw -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Raw } It "Should have IncludeFragmentation as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeFragmentation -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeFragmentation } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaHideInstance.Tests.ps1 b/tests/Get-DbaHideInstance.Tests.ps1 index c5508b09d4..3b49883cfc 100644 --- a/tests/Get-DbaHideInstance.Tests.ps1 +++ b/tests/Get-DbaHideInstance.Tests.ps1 @@ -10,13 +10,13 @@ Describe "Get-DbaHideInstance" { $CommandUnderTest = Get-Command Get-DbaHideInstance } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaInstalledPatch.Tests.ps1 b/tests/Get-DbaInstalledPatch.Tests.ps1 index 9a283fb185..b334bcf479 100644 --- a/tests/Get-DbaInstalledPatch.Tests.ps1 +++ b/tests/Get-DbaInstalledPatch.Tests.ps1 @@ -9,14 +9,14 @@ Describe "Get-DbaInstalledPatch" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaInstalledPatch } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaInstanceAudit.Tests.ps1 b/tests/Get-DbaInstanceAudit.Tests.ps1 index a8cfdbcc1f..fe077d8083 100644 --- a/tests/Get-DbaInstanceAudit.Tests.ps1 +++ b/tests/Get-DbaInstanceAudit.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Get-DbaInstanceAudit" { $CommandUnderTest = Get-Command Get-DbaInstanceAudit } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Audit as a parameter" { - $CommandUnderTest | Should -HaveParameter Audit -Type System.String[] + $CommandUnderTest | Should -HaveParameter Audit } It "Should have ExcludeAudit as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeAudit -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeAudit } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaInstanceAuditSpecification.Tests.ps1 b/tests/Get-DbaInstanceAuditSpecification.Tests.ps1 index fbf9bc32be..324503b988 100644 --- a/tests/Get-DbaInstanceAuditSpecification.Tests.ps1 +++ b/tests/Get-DbaInstanceAuditSpecification.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaInstanceAuditSpecification" { $CommandUnderTest = Get-Command Get-DbaInstanceAuditSpecification } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaInstanceInstallDate.Tests.ps1 b/tests/Get-DbaInstanceInstallDate.Tests.ps1 index 3a6cb0072c..9d16f0f632 100644 --- a/tests/Get-DbaInstanceInstallDate.Tests.ps1 +++ b/tests/Get-DbaInstanceInstallDate.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Get-DbaInstanceInstallDate" { $CommandUnderTest = Get-Command Get-DbaInstanceInstallDate } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have IncludeWindows as a parameter" { - $CommandUnderTest | Should -HaveParameter IncludeWindows -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeWindows } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaInstanceProperty.Tests.ps1 b/tests/Get-DbaInstanceProperty.Tests.ps1 index 1f62b1e54f..385332f05f 100644 --- a/tests/Get-DbaInstanceProperty.Tests.ps1 +++ b/tests/Get-DbaInstanceProperty.Tests.ps1 @@ -11,19 +11,19 @@ Describe "Get-DbaInstanceProperty" { $CommandUnderTest = Get-Command Get-DbaInstanceProperty } It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have InstanceProperty as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter InstanceProperty -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InstanceProperty } It "Should have ExcludeInstanceProperty as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeInstanceProperty -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeInstanceProperty } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaInstanceProtocol.Tests.ps1 b/tests/Get-DbaInstanceProtocol.Tests.ps1 index b1dc8a0a57..84c2c50983 100644 --- a/tests/Get-DbaInstanceProtocol.Tests.ps1 +++ b/tests/Get-DbaInstanceProtocol.Tests.ps1 @@ -9,14 +9,14 @@ Describe "Get-DbaInstanceProtocol" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaInstanceProtocol } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaInstanceTrigger.Tests.ps1 b/tests/Get-DbaInstanceTrigger.Tests.ps1 index bf09bd003c..1b21f95642 100644 --- a/tests/Get-DbaInstanceTrigger.Tests.ps1 +++ b/tests/Get-DbaInstanceTrigger.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbaInstanceTrigger Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaInstanceTrigger } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaInstanceUserOption.Tests.ps1 b/tests/Get-DbaInstanceUserOption.Tests.ps1 index 1d1ef0eeb7..138196d56d 100644 --- a/tests/Get-DbaInstanceUserOption.Tests.ps1 +++ b/tests/Get-DbaInstanceUserOption.Tests.ps1 @@ -10,13 +10,13 @@ Describe "Get-DbaInstanceUserOption" { $CommandUnderTest = Get-Command Get-DbaInstanceUserOption } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaIoLatency.Tests.ps1 b/tests/Get-DbaIoLatency.Tests.ps1 index 48c613fc61..4ab6a89199 100644 --- a/tests/Get-DbaIoLatency.Tests.ps1 +++ b/tests/Get-DbaIoLatency.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaIoLatency" { $CommandUnderTest = Get-Command Get-DbaIoLatency } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaKbUpdate.Tests.ps1 b/tests/Get-DbaKbUpdate.Tests.ps1 index bcb970317c..9377fb0500 100644 --- a/tests/Get-DbaKbUpdate.Tests.ps1 +++ b/tests/Get-DbaKbUpdate.Tests.ps1 @@ -11,16 +11,16 @@ Describe "Get-DbaKbUpdate" { $CommandUnderTest = Get-Command Get-DbaKbUpdate } It "Should have Name as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Name } It "Should have Simple as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter Simple -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Simple } It "Should have Language as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Language -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Language } It "Should have EnableException as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaLastBackup.Tests.ps1 b/tests/Get-DbaLastBackup.Tests.ps1 index b4494b665f..fc9a5aa0a3 100644 --- a/tests/Get-DbaLastBackup.Tests.ps1 +++ b/tests/Get-DbaLastBackup.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Get-DbaLastBackup Unit Tests" -Tag 'UnitTests' { $Command = Get-Command Get-DbaLastBackup } It "Should have SqlInstance parameter" { - $Command | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $Command | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $Command | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $Command | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $Command | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $Command | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $Command | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $Command | Should -HaveParameter ExcludeDatabase } It "Should have EnableException parameter" { - $Command | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $Command | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaLastGoodCheckDb.Tests.ps1 b/tests/Get-DbaLastGoodCheckDb.Tests.ps1 index 579c13b032..5b544ae021 100644 --- a/tests/Get-DbaLastGoodCheckDb.Tests.ps1 +++ b/tests/Get-DbaLastGoodCheckDb.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaLastGoodCheckDb" { $CommandUnderTest = Get-Command Get-DbaLastGoodCheckDb } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaLatchStatistic.Tests.ps1 b/tests/Get-DbaLatchStatistic.Tests.ps1 index 6d4ef3b89a..6404de1b45 100644 --- a/tests/Get-DbaLatchStatistic.Tests.ps1 +++ b/tests/Get-DbaLatchStatistic.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Get-DbaLatchStatistic" { $CommandUnderTest = Get-Command Get-DbaLatchStatistic } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Threshold as a parameter" { - $CommandUnderTest | Should -HaveParameter Threshold -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Threshold } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaLinkedServer.Tests.ps1 b/tests/Get-DbaLinkedServer.Tests.ps1 index 4f2e5ae347..5d966c3649 100644 --- a/tests/Get-DbaLinkedServer.Tests.ps1 +++ b/tests/Get-DbaLinkedServer.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Get-DbaLinkedServer" { $CommandUnderTest = Get-Command Get-DbaLinkedServer } It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have LinkedServer as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter LinkedServer -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LinkedServer } It "Should have ExcludeLinkedServer as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeLinkedServer -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeLinkedServer } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaLinkedServerLogin.Tests.ps1 b/tests/Get-DbaLinkedServerLogin.Tests.ps1 index 06352d56e7..3758bbed6d 100644 --- a/tests/Get-DbaLinkedServerLogin.Tests.ps1 +++ b/tests/Get-DbaLinkedServerLogin.Tests.ps1 @@ -60,25 +60,25 @@ Describe "Get-DbaLinkedServerLogin" { $CommandUnderTest = Get-Command Get-DbaLinkedServerLogin } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have LinkedServer as a parameter" { - $CommandUnderTest | Should -HaveParameter LinkedServer -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LinkedServer } It "Should have LocalLogin as a parameter" { - $CommandUnderTest | Should -HaveParameter LocalLogin -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LocalLogin } It "Should have ExcludeLocalLogin as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeLocalLogin -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeLocalLogin } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaLocaleSetting.Tests.ps1 b/tests/Get-DbaLocaleSetting.Tests.ps1 index 05a3757054..f567a23b0b 100644 --- a/tests/Get-DbaLocaleSetting.Tests.ps1 +++ b/tests/Get-DbaLocaleSetting.Tests.ps1 @@ -11,14 +11,14 @@ Describe "Get-DbaLocaleSetting" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaLocaleSetting } - It "Should have ComputerName as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type System.String[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaLogin.Tests.ps1 b/tests/Get-DbaLogin.Tests.ps1 index 579231e6c5..eefb82bdaf 100644 --- a/tests/Get-DbaLogin.Tests.ps1 +++ b/tests/Get-DbaLogin.Tests.ps1 @@ -21,46 +21,46 @@ Describe "Get-DbaLogin" { $CommandUnderTest = Get-Command Get-DbaLogin } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Login parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Login } It "Should have IncludeFilter parameter" { - $CommandUnderTest | Should -HaveParameter IncludeFilter -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeFilter } It "Should have ExcludeLogin parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeLogin -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeLogin } It "Should have ExcludeFilter parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeFilter -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeFilter } It "Should have ExcludeSystemLogin parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemLogin -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeSystemLogin } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type } It "Should have HasAccess parameter" { - $CommandUnderTest | Should -HaveParameter HasAccess -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter HasAccess } It "Should have Locked parameter" { - $CommandUnderTest | Should -HaveParameter Locked -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Locked } It "Should have Disabled parameter" { - $CommandUnderTest | Should -HaveParameter Disabled -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Disabled } It "Should have MustChangePassword parameter" { - $CommandUnderTest | Should -HaveParameter MustChangePassword -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MustChangePassword } It "Should have Detailed parameter" { - $CommandUnderTest | Should -HaveParameter Detailed -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Detailed } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaMaintenanceSolutionLog.Tests.ps1 b/tests/Get-DbaMaintenanceSolutionLog.Tests.ps1 index 1e80b6445e..916dbbdec5 100644 --- a/tests/Get-DbaMaintenanceSolutionLog.Tests.ps1 +++ b/tests/Get-DbaMaintenanceSolutionLog.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Get-DbaMaintenanceSolutionLog" { $CommandUnderTest = Get-Command Get-DbaMaintenanceSolutionLog } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have LogType as a parameter" { - $CommandUnderTest | Should -HaveParameter LogType -Type System.String[] + $CommandUnderTest | Should -HaveParameter LogType } It "Should have Since as a parameter" { - $CommandUnderTest | Should -HaveParameter Since -Type System.DateTime + $CommandUnderTest | Should -HaveParameter Since } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaManagementObject.Tests.ps1 b/tests/Get-DbaManagementObject.Tests.ps1 index f980b73703..22c4f1c69a 100644 --- a/tests/Get-DbaManagementObject.Tests.ps1 +++ b/tests/Get-DbaManagementObject.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Get-DbaManagementObject" { $CommandUnderTest = Get-Command Get-DbaManagementObject } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have VersionNumber as a parameter" { - $CommandUnderTest | Should -HaveParameter VersionNumber -Type System.Int32 + $CommandUnderTest | Should -HaveParameter VersionNumber } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaMaxMemory.Tests.ps1 b/tests/Get-DbaMaxMemory.Tests.ps1 index b863bda6e4..990cfb5f5c 100644 --- a/tests/Get-DbaMaxMemory.Tests.ps1 +++ b/tests/Get-DbaMaxMemory.Tests.ps1 @@ -11,13 +11,13 @@ Describe "Get-DbaMaxMemory" { $CommandUnderTest = Get-Command Get-DbaMaxMemory } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaMemoryCondition.Tests.ps1 b/tests/Get-DbaMemoryCondition.Tests.ps1 index e5a2f84888..e70c4b4a4c 100644 --- a/tests/Get-DbaMemoryCondition.Tests.ps1 +++ b/tests/Get-DbaMemoryCondition.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaMemoryCondition" { $CommandUnderTest = Get-Command Get-DbaMemoryCondition } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaMemoryUsage.Tests.ps1 b/tests/Get-DbaMemoryUsage.Tests.ps1 index 55e5030548..4c49d660f1 100644 --- a/tests/Get-DbaMemoryUsage.Tests.ps1 +++ b/tests/Get-DbaMemoryUsage.Tests.ps1 @@ -11,28 +11,28 @@ Describe "Get-DbaMemoryUsage" { $CommandUnderTest = Get-Command Get-DbaMemoryUsage } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type Microsoft.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have MemoryCounterRegex as a parameter" { - $CommandUnderTest | Should -HaveParameter MemoryCounterRegex -Type System.String + $CommandUnderTest | Should -HaveParameter MemoryCounterRegex } It "Should have PlanCounterRegex as a parameter" { - $CommandUnderTest | Should -HaveParameter PlanCounterRegex -Type System.String + $CommandUnderTest | Should -HaveParameter PlanCounterRegex } It "Should have BufferCounterRegex as a parameter" { - $CommandUnderTest | Should -HaveParameter BufferCounterRegex -Type System.String + $CommandUnderTest | Should -HaveParameter BufferCounterRegex } It "Should have SSASCounterRegex as a parameter" { - $CommandUnderTest | Should -HaveParameter SSASCounterRegex -Type System.String + $CommandUnderTest | Should -HaveParameter SSASCounterRegex } It "Should have SSISCounterRegex as a parameter" { - $CommandUnderTest | Should -HaveParameter SSISCounterRegex -Type System.String + $CommandUnderTest | Should -HaveParameter SSISCounterRegex } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaModule.Tests.ps1 b/tests/Get-DbaModule.Tests.ps1 index de81e45716..7d85db80cb 100644 --- a/tests/Get-DbaModule.Tests.ps1 +++ b/tests/Get-DbaModule.Tests.ps1 @@ -12,34 +12,34 @@ Describe "Get-DbaModule" { $CommandUnderTest = Get-Command Get-DbaModule } It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.SqlServer.Management.Smo.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have ModifiedSince as a non-mandatory parameter of type System.DateTime" { - $CommandUnderTest | Should -HaveParameter ModifiedSince -Type System.DateTime -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ModifiedSince } It "Should have Type as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type } It "Should have ExcludeSystemDatabases as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemDatabases -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeSystemDatabases } It "Should have ExcludeSystemObjects as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemObjects -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeSystemObjects } It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaMsdtc.Tests.ps1 b/tests/Get-DbaMsdtc.Tests.ps1 index ed8b262285..46b3f3a512 100644 --- a/tests/Get-DbaMsdtc.Tests.ps1 +++ b/tests/Get-DbaMsdtc.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbaMsdtc" { $CommandUnderTest = Get-Command Get-DbaMsdtc } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaNetworkActivity.Tests.ps1 b/tests/Get-DbaNetworkActivity.Tests.ps1 index e6d42fcd3e..1203255318 100644 --- a/tests/Get-DbaNetworkActivity.Tests.ps1 +++ b/tests/Get-DbaNetworkActivity.Tests.ps1 @@ -11,14 +11,14 @@ Describe "Get-DbaNetworkActivity" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaNetworkActivity } - It "Should have ComputerName as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type System.String[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaNetworkCertificate.Tests.ps1 b/tests/Get-DbaNetworkCertificate.Tests.ps1 index 6ed0d55238..5972b3ac50 100644 --- a/tests/Get-DbaNetworkCertificate.Tests.ps1 +++ b/tests/Get-DbaNetworkCertificate.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaNetworkCertificate" { $CommandUnderTest = Get-Command Get-DbaNetworkCertificate } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaNetworkConfiguration.Tests.ps1 b/tests/Get-DbaNetworkConfiguration.Tests.ps1 index fdd8a5d1c2..bd0fc4d94e 100644 --- a/tests/Get-DbaNetworkConfiguration.Tests.ps1 +++ b/tests/Get-DbaNetworkConfiguration.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Get-DbaNetworkConfiguration" { $CommandUnderTest = Get-Command Get-DbaNetworkConfiguration } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have OutputType as a parameter" { - $CommandUnderTest | Should -HaveParameter OutputType -Type System.String + $CommandUnderTest | Should -HaveParameter OutputType } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaOleDbProvider.Tests.ps1 b/tests/Get-DbaOleDbProvider.Tests.ps1 index e9c146d922..45361d3937 100644 --- a/tests/Get-DbaOleDbProvider.Tests.ps1 +++ b/tests/Get-DbaOleDbProvider.Tests.ps1 @@ -5,17 +5,17 @@ Describe "Get-DbaOleDbProvider" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaOleDbProvider } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Provider as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Provider -Type System.String[] -Mandatory:$false + It "Should have Provider as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Provider } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaOpenTransaction.Tests.ps1 b/tests/Get-DbaOpenTransaction.Tests.ps1 index d3902daeee..0e5e28baab 100644 --- a/tests/Get-DbaOpenTransaction.Tests.ps1 +++ b/tests/Get-DbaOpenTransaction.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbaOpenTransaction" { $CommandUnderTest = Get-Command Get-DbaOpenTransaction } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaOperatingSystem.Tests.ps1 b/tests/Get-DbaOperatingSystem.Tests.ps1 index ada86d5671..f4b8e71d80 100644 --- a/tests/Get-DbaOperatingSystem.Tests.ps1 +++ b/tests/Get-DbaOperatingSystem.Tests.ps1 @@ -10,13 +10,13 @@ Describe "Get-DbaOperatingSystem" { $CommandUnderTest = Get-Command Get-DbaOperatingSystem } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaPageFileSetting.Tests.ps1 b/tests/Get-DbaPageFileSetting.Tests.ps1 index 7e1fae2f40..2d8365fa6d 100644 --- a/tests/Get-DbaPageFileSetting.Tests.ps1 +++ b/tests/Get-DbaPageFileSetting.Tests.ps1 @@ -11,14 +11,14 @@ Describe "Get-DbaPageFileSetting" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaPageFileSetting } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaPbmCategory.Tests.ps1 b/tests/Get-DbaPbmCategory.Tests.ps1 index 284023acaf..a94245eaa7 100644 --- a/tests/Get-DbaPbmCategory.Tests.ps1 +++ b/tests/Get-DbaPbmCategory.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Get-DbaPbmCategory" { $CommandUnderTest = Get-Command Get-DbaPbmCategory } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Category as a parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Category } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Management.Automation.PSObject[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have ExcludeSystemObject as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemObject -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeSystemObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaPbmCategorySubscription.Tests.ps1 b/tests/Get-DbaPbmCategorySubscription.Tests.ps1 index 0a457fc82a..ebf33b50d2 100644 --- a/tests/Get-DbaPbmCategorySubscription.Tests.ps1 +++ b/tests/Get-DbaPbmCategorySubscription.Tests.ps1 @@ -5,17 +5,17 @@ Describe "Get-DbaPbmCategorySubscription" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaPbmCategorySubscription } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have InputObject as a non-mandatory parameter of type System.Management.Automation.PSObject[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Management.Automation.PSObject[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaPbmCondition.Tests.ps1 b/tests/Get-DbaPbmCondition.Tests.ps1 index 6c153542dc..e58373437c 100644 --- a/tests/Get-DbaPbmCondition.Tests.ps1 +++ b/tests/Get-DbaPbmCondition.Tests.ps1 @@ -5,23 +5,23 @@ Describe "Get-DbaPbmCondition" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaPbmCondition } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Condition as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Condition -Type System.String[] -Mandatory:$false + It "Should have Condition as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Condition } - It "Should have InputObject as a non-mandatory parameter of type System.Management.Automation.PSObject[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Management.Automation.PSObject[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have IncludeSystemObject as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemObject -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeSystemObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } @@ -45,7 +45,7 @@ Describe "Get-DbaPbmCondition Integration Tests" -Tag "IntegrationTests" { String - System.String + System.String test ', @is_name_condition=1, @obj_name=N'test', @condition_id=@condition_id OUTPUT diff --git a/tests/Get-DbaPbmObjectSet.Tests.ps1 b/tests/Get-DbaPbmObjectSet.Tests.ps1 index a1adeeba43..6ddae9ff81 100644 --- a/tests/Get-DbaPbmObjectSet.Tests.ps1 +++ b/tests/Get-DbaPbmObjectSet.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaPbmObjectSet" { $CommandUnderTest = Get-Command Get-DbaPbmObjectSet } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have ObjectSet as a parameter" { - $CommandUnderTest | Should -HaveParameter ObjectSet -Type System.String[] + $CommandUnderTest | Should -HaveParameter ObjectSet } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Management.Automation.PSObject[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have IncludeSystemObject as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemObject -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSystemObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaPbmPolicy.Tests.ps1 b/tests/Get-DbaPbmPolicy.Tests.ps1 index 5887fb661f..ebbd14e005 100644 --- a/tests/Get-DbaPbmPolicy.Tests.ps1 +++ b/tests/Get-DbaPbmPolicy.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Get-DbaPbmPolicy" { $CommandUnderTest = Get-Command Get-DbaPbmPolicy } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Policy as a parameter" { - $CommandUnderTest | Should -HaveParameter Policy -Type System.String[] + $CommandUnderTest | Should -HaveParameter Policy } It "Should have Category as a parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type System.String[] + $CommandUnderTest | Should -HaveParameter Category } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have IncludeSystemObject as a parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemObject -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSystemObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaPbmStore.Tests.ps1 b/tests/Get-DbaPbmStore.Tests.ps1 index afd093e7fd..fc53506bbb 100644 --- a/tests/Get-DbaPbmStore.Tests.ps1 +++ b/tests/Get-DbaPbmStore.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbaPbmStore" { $CommandUnderTest = Get-Command Get-DbaPbmStore } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaPermission.Tests.ps1 b/tests/Get-DbaPermission.Tests.ps1 index 9ac3dacccb..c2286d2c45 100644 --- a/tests/Get-DbaPermission.Tests.ps1 +++ b/tests/Get-DbaPermission.Tests.ps1 @@ -12,25 +12,25 @@ Describe "Get-DbaPermission Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaPermission } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have IncludeServerLevel as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeServerLevel -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeServerLevel } It "Should have ExcludeSystemObjects as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemObjects -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeSystemObjects } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaPfAvailableCounter.Tests.ps1 b/tests/Get-DbaPfAvailableCounter.Tests.ps1 index 2f86c41950..28a348bd6a 100644 --- a/tests/Get-DbaPfAvailableCounter.Tests.ps1 +++ b/tests/Get-DbaPfAvailableCounter.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Get-DbaPfAvailableCounter" { $CommandUnderTest = Get-Command Get-DbaPfAvailableCounter } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Pattern as a parameter" { - $CommandUnderTest | Should -HaveParameter Pattern -Type System.String + $CommandUnderTest | Should -HaveParameter Pattern } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -24,7 +24,7 @@ Describe "Get-DbaPfAvailableCounter" { $null = Get-DbaPfDataCollectorSetTemplate -Template 'Long Running Queries' | Import-DbaPfDataCollectorSetTemplate } AfterAll { - $null = Get-DbaPfDataCollectorSet -CollectorSet 'Long Running Queries' | Remove-DbaPfDataCollectorSet -Confirm:$false + $null = Get-DbaPfDataCollectorSet -CollectorSet 'Long Running Queries' | Remove-DbaPfDataCollectorSet } It "returns the correct values" { diff --git a/tests/Get-DbaPfDataCollector.Tests.ps1 b/tests/Get-DbaPfDataCollector.Tests.ps1 index 7cafed8795..57b72855ab 100644 --- a/tests/Get-DbaPfDataCollector.Tests.ps1 +++ b/tests/Get-DbaPfDataCollector.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Get-DbaPfDataCollector" { $CommandUnderTest = Get-Command Get-DbaPfDataCollector } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have CollectorSet as a parameter" { - $CommandUnderTest | Should -HaveParameter CollectorSet -Type System.String[] + $CommandUnderTest | Should -HaveParameter CollectorSet } It "Should have Collector as a parameter" { - $CommandUnderTest | Should -HaveParameter Collector -Type System.String[] + $CommandUnderTest | Should -HaveParameter Collector } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaPfDataCollectorCounter.Tests.ps1 b/tests/Get-DbaPfDataCollectorCounter.Tests.ps1 index 22190286db..5eb0cb10db 100644 --- a/tests/Get-DbaPfDataCollectorCounter.Tests.ps1 +++ b/tests/Get-DbaPfDataCollectorCounter.Tests.ps1 @@ -12,25 +12,25 @@ Describe "Get-DbaPfDataCollectorCounter" { $CommandUnderTest = Get-Command Get-DbaPfDataCollectorCounter } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have CollectorSet as a parameter" { - $CommandUnderTest | Should -HaveParameter CollectorSet -Type System.String[] + $CommandUnderTest | Should -HaveParameter CollectorSet } It "Should have Collector as a parameter" { - $CommandUnderTest | Should -HaveParameter Collector -Type System.String[] + $CommandUnderTest | Should -HaveParameter Collector } It "Should have Counter as a parameter" { - $CommandUnderTest | Should -HaveParameter Counter -Type System.String[] + $CommandUnderTest | Should -HaveParameter Counter } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaPfDataCollectorCounterSample.Tests.ps1 b/tests/Get-DbaPfDataCollectorCounterSample.Tests.ps1 index 2a714d11c5..c3bbb87b38 100644 --- a/tests/Get-DbaPfDataCollectorCounterSample.Tests.ps1 +++ b/tests/Get-DbaPfDataCollectorCounterSample.Tests.ps1 @@ -6,37 +6,37 @@ Describe "Get-DbaPfDataCollectorCounterSample" { $CommandUnderTest = Get-Command Get-DbaPfDataCollectorCounterSample } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have CollectorSet as a parameter" { - $CommandUnderTest | Should -HaveParameter CollectorSet -Type System.String[] + $CommandUnderTest | Should -HaveParameter CollectorSet } It "Should have Collector as a parameter" { - $CommandUnderTest | Should -HaveParameter Collector -Type System.String[] + $CommandUnderTest | Should -HaveParameter Collector } It "Should have Counter as a parameter" { - $CommandUnderTest | Should -HaveParameter Counter -Type System.String[] + $CommandUnderTest | Should -HaveParameter Counter } It "Should have Continuous as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Continuous -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Continuous } It "Should have ListSet as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ListSet -Type System.Management.Automation.SwitchParameter[] + $CommandUnderTest | Should -HaveParameter ListSet } It "Should have MaxSamples as a parameter" { - $CommandUnderTest | Should -HaveParameter MaxSamples -Type System.Int32 + $CommandUnderTest | Should -HaveParameter MaxSamples } It "Should have SampleInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter SampleInterval -Type System.Int32 + $CommandUnderTest | Should -HaveParameter SampleInterval } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaPfDataCollectorSet.Tests.ps1 b/tests/Get-DbaPfDataCollectorSet.Tests.ps1 index b4c94e2517..712bf15917 100644 --- a/tests/Get-DbaPfDataCollectorSet.Tests.ps1 +++ b/tests/Get-DbaPfDataCollectorSet.Tests.ps1 @@ -9,17 +9,17 @@ Describe "Get-DbaPfDataCollectorSet" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaPfDataCollectorSet } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } - It "Should have CollectorSet as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter CollectorSet -Type System.String[] -Mandatory:$false + It "Should have CollectorSet as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter CollectorSet } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaPfDataCollectorSetTemplate.Tests.ps1 b/tests/Get-DbaPfDataCollectorSetTemplate.Tests.ps1 index a5e90be93f..ce28e14365 100644 --- a/tests/Get-DbaPfDataCollectorSetTemplate.Tests.ps1 +++ b/tests/Get-DbaPfDataCollectorSetTemplate.Tests.ps1 @@ -11,17 +11,17 @@ Describe "Get-DbaPfDataCollectorSetTemplate" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaPfDataCollectorSetTemplate } - It "Should have Path as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String[] -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } - It "Should have Pattern as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Pattern -Type System.String -Mandatory:$false + It "Should have Pattern as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Pattern } - It "Should have Template as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter Template -Type System.String[] -Mandatory:$false + It "Should have Template as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Template } - It "Should have EnableException as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have EnableException as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaPlanCache.Tests.ps1 b/tests/Get-DbaPlanCache.Tests.ps1 index a1190210db..b119ca93fc 100644 --- a/tests/Get-DbaPlanCache.Tests.ps1 +++ b/tests/Get-DbaPlanCache.Tests.ps1 @@ -10,13 +10,13 @@ Describe "Get-DbaPlanCache" { $CommandUnderTest = Get-Command Get-DbaPlanCache } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaPowerPlan.Tests.ps1 b/tests/Get-DbaPowerPlan.Tests.ps1 index 0ca4001e6f..84212d7b72 100644 --- a/tests/Get-DbaPowerPlan.Tests.ps1 +++ b/tests/Get-DbaPowerPlan.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Get-DbaPowerPlan" { $CommandUnderTest = Get-Command Get-DbaPowerPlan } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have List as a switch parameter" { - $CommandUnderTest | Should -HaveParameter List -Type switch + $CommandUnderTest | Should -HaveParameter List } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaPrivilege.Tests.ps1 b/tests/Get-DbaPrivilege.Tests.ps1 index 3cad525ced..6fb547c841 100644 --- a/tests/Get-DbaPrivilege.Tests.ps1 +++ b/tests/Get-DbaPrivilege.Tests.ps1 @@ -5,14 +5,14 @@ Describe "Get-DbaPrivilege" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaPrivilege } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaProcess.Tests.ps1 b/tests/Get-DbaProcess.Tests.ps1 index b05c9ea457..e37e1add73 100644 --- a/tests/Get-DbaProcess.Tests.ps1 +++ b/tests/Get-DbaProcess.Tests.ps1 @@ -12,34 +12,34 @@ Describe "Get-DbaProcess" { $CommandUnderTest = Get-Command Get-DbaProcess } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Spid as a parameter" { - $CommandUnderTest | Should -HaveParameter Spid -Type Int32[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Spid } It "Should have ExcludeSpid as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSpid -Type Int32[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeSpid } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Login } It "Should have Hostname as a parameter" { - $CommandUnderTest | Should -HaveParameter Hostname -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Hostname } It "Should have Program as a parameter" { - $CommandUnderTest | Should -HaveParameter Program -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Program } It "Should have ExcludeSystemSpids as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemSpids -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeSystemSpids } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaProductKey.Tests.ps1 b/tests/Get-DbaProductKey.Tests.ps1 index d159bf7ef2..a96e9b72ae 100644 --- a/tests/Get-DbaProductKey.Tests.ps1 +++ b/tests/Get-DbaProductKey.Tests.ps1 @@ -5,17 +5,17 @@ Describe "Get-DbaProductKey" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaProductKey } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaQueryExecutionTime.Tests.ps1 b/tests/Get-DbaQueryExecutionTime.Tests.ps1 index 8951bf48d9..ac77c09326 100644 --- a/tests/Get-DbaQueryExecutionTime.Tests.ps1 +++ b/tests/Get-DbaQueryExecutionTime.Tests.ps1 @@ -5,32 +5,32 @@ Describe "Get-DbaQueryExecutionTime" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaQueryExecutionTime } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have ExcludeDatabase as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + It "Should have ExcludeDatabase as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } - It "Should have MaxResultsPerDb as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter MaxResultsPerDb -Type System.Int32 -Mandatory:$false + It "Should have MaxResultsPerDb as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter MaxResultsPerDb } - It "Should have MinExecs as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter MinExecs -Type System.Int32 -Mandatory:$false + It "Should have MinExecs as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter MinExecs } - It "Should have MinExecMs as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter MinExecMs -Type System.Int32 -Mandatory:$false + It "Should have MinExecMs as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter MinExecMs } It "Should have ExcludeSystem as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystem -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeSystem } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaRandomizedDataset.Tests.ps1 b/tests/Get-DbaRandomizedDataset.Tests.ps1 index 0aadd49239..54295a8a48 100644 --- a/tests/Get-DbaRandomizedDataset.Tests.ps1 +++ b/tests/Get-DbaRandomizedDataset.Tests.ps1 @@ -5,23 +5,23 @@ Describe "Get-DbaRandomizedDataset" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaRandomizedDataset } - It "Should have Template as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Template -Type System.String[] -Mandatory:$false + It "Should have Template as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Template } - It "Should have TemplateFile as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter TemplateFile -Type System.String[] -Mandatory:$false + It "Should have TemplateFile as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter TemplateFile } - It "Should have Rows as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter Rows -Type System.Int32 -Mandatory:$false + It "Should have Rows as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Rows } - It "Should have Locale as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Locale -Type System.String -Mandatory:$false + It "Should have Locale as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Locale } - It "Should have InputObject as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaRandomizedDatasetTemplate.Tests.ps1 b/tests/Get-DbaRandomizedDatasetTemplate.Tests.ps1 index 5d37d5ec24..60a27ae0f2 100644 --- a/tests/Get-DbaRandomizedDatasetTemplate.Tests.ps1 +++ b/tests/Get-DbaRandomizedDatasetTemplate.Tests.ps1 @@ -11,17 +11,17 @@ Describe "Get-DbaRandomizedDatasetTemplate" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaRandomizedDatasetTemplate } - It "Should have Template as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Template -Type System.String[] -Mandatory:$false + It "Should have Template as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Template } - It "Should have Path as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String[] -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } It "Should have ExcludeDefault as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDefault -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDefault } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaRandomizedType.Tests.ps1 b/tests/Get-DbaRandomizedType.Tests.ps1 index 04b7498994..0c277a5fd7 100644 --- a/tests/Get-DbaRandomizedType.Tests.ps1 +++ b/tests/Get-DbaRandomizedType.Tests.ps1 @@ -10,17 +10,17 @@ Describe "Get-DbaRandomizedType" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaRandomizedType } - It "Should have RandomizedType as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter RandomizedType -Type System.String[] -Mandatory:$false + It "Should have RandomizedType as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter RandomizedType } - It "Should have RandomizedSubType as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter RandomizedSubType -Type System.String[] -Mandatory:$false + It "Should have RandomizedSubType as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter RandomizedSubType } - It "Should have Pattern as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Pattern -Type System.String -Mandatory:$false + It "Should have Pattern as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Pattern } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaRandomizedValue.Tests.ps1 b/tests/Get-DbaRandomizedValue.Tests.ps1 index b43e4a0517..269b28d164 100644 --- a/tests/Get-DbaRandomizedValue.Tests.ps1 +++ b/tests/Get-DbaRandomizedValue.Tests.ps1 @@ -5,44 +5,44 @@ Describe "Get-DbaRandomizedValue" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaRandomizedValue } - It "Should have DataType as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter DataType -Type System.String -Mandatory:$false + It "Should have DataType as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter DataType } - It "Should have RandomizerType as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter RandomizerType -Type System.String -Mandatory:$false + It "Should have RandomizerType as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter RandomizerType } - It "Should have RandomizerSubType as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter RandomizerSubType -Type System.String -Mandatory:$false + It "Should have RandomizerSubType as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter RandomizerSubType } - It "Should have Min as a non-mandatory System.Object parameter" { - $CommandUnderTest | Should -HaveParameter Min -Type System.Object -Mandatory:$false + It "Should have Min as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Min } - It "Should have Max as a non-mandatory System.Object parameter" { - $CommandUnderTest | Should -HaveParameter Max -Type System.Object -Mandatory:$false + It "Should have Max as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Max } - It "Should have Precision as a non-mandatory System.Int32 parameter" { - $CommandUnderTest | Should -HaveParameter Precision -Type System.Int32 -Mandatory:$false + It "Should have Precision as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Precision } - It "Should have CharacterString as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter CharacterString -Type System.String -Mandatory:$false + It "Should have CharacterString as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter CharacterString } - It "Should have Format as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Format -Type System.String -Mandatory:$false + It "Should have Format as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Format } - It "Should have Symbol as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Symbol -Type System.String -Mandatory:$false + It "Should have Symbol as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Symbol } - It "Should have Separator as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Separator -Type System.String -Mandatory:$false + It "Should have Separator as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Separator } - It "Should have Value as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Value -Type System.String -Mandatory:$false + It "Should have Value as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Value } - It "Should have Locale as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Locale -Type System.String -Mandatory:$false + It "Should have Locale as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Locale } - It "Should have EnableException as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have EnableException as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaRegServer.Tests.ps1 b/tests/Get-DbaRegServer.Tests.ps1 index 2525f1cd66..f4f92db524 100644 --- a/tests/Get-DbaRegServer.Tests.ps1 +++ b/tests/Get-DbaRegServer.Tests.ps1 @@ -61,37 +61,37 @@ Describe "Get-DbaRegServer" { $CommandUnderTest = Get-Command Get-DbaRegServer } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] + $CommandUnderTest | Should -HaveParameter Name } It "Should have ServerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ServerName -Type System.String[] + $CommandUnderTest | Should -HaveParameter ServerName } It "Should have Group as a parameter" { - $CommandUnderTest | Should -HaveParameter Group -Type System.String[] + $CommandUnderTest | Should -HaveParameter Group } It "Should have ExcludeGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeGroup -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeGroup } It "Should have Id as a parameter" { - $CommandUnderTest | Should -HaveParameter Id -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter Id } It "Should have IncludeSelf as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSelf -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSelf } It "Should have ResolveNetworkName as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ResolveNetworkName -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ResolveNetworkName } It "Should have IncludeLocal as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeLocal -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeLocal } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaRegServerGroup.Tests.ps1 b/tests/Get-DbaRegServerGroup.Tests.ps1 index 56acd7a86b..32a97b708c 100644 --- a/tests/Get-DbaRegServerGroup.Tests.ps1 +++ b/tests/Get-DbaRegServerGroup.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaRegServerGroup" { $CommandUnderTest = Get-Command Get-DbaRegServerGroup } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Group as a parameter" { - $CommandUnderTest | Should -HaveParameter Group -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Group } It "Should have ExcludeGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeGroup -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeGroup } It "Should have Id as a parameter" { - $CommandUnderTest | Should -HaveParameter Id -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter Id } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaRegServerStore.Tests.ps1 b/tests/Get-DbaRegServerStore.Tests.ps1 index 28f3b67709..d776afc674 100644 --- a/tests/Get-DbaRegServerStore.Tests.ps1 +++ b/tests/Get-DbaRegServerStore.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbaRegServerStore" { $CommandUnderTest = Get-Command Get-DbaRegServerStore } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaRegistryRoot.Tests.ps1 b/tests/Get-DbaRegistryRoot.Tests.ps1 index e0e9eca160..0fc0a357ab 100644 --- a/tests/Get-DbaRegistryRoot.Tests.ps1 +++ b/tests/Get-DbaRegistryRoot.Tests.ps1 @@ -5,14 +5,14 @@ Describe "Get-DbaRegistryRoot" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaRegistryRoot } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaReplArticle.Tests.ps1 b/tests/Get-DbaReplArticle.Tests.ps1 index b7b5210f54..54ea03d1b9 100644 --- a/tests/Get-DbaReplArticle.Tests.ps1 +++ b/tests/Get-DbaReplArticle.Tests.ps1 @@ -10,26 +10,26 @@ Describe "Get-DbaReplArticle" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaReplArticle } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have Publication as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Publication -Type System.Object[] -Mandatory:$false + It "Should have Publication as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Publication } - It "Should have Schema as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String[] -Mandatory:$false + It "Should have Schema as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Schema } - It "Should have Name as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] -Mandatory:$false + It "Should have Name as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Name } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaReplArticleColumn.Tests.ps1 b/tests/Get-DbaReplArticleColumn.Tests.ps1 index 90b0fcc0fc..f546767714 100644 --- a/tests/Get-DbaReplArticleColumn.Tests.ps1 +++ b/tests/Get-DbaReplArticleColumn.Tests.ps1 @@ -10,26 +10,26 @@ Describe "Get-DbaReplArticleColumn" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaReplArticleColumn } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have Publication as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Publication -Type System.Object[] -Mandatory:$false + It "Should have Publication as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Publication } - It "Should have Article as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Article -Type System.String[] -Mandatory:$false + It "Should have Article as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Article } - It "Should have Column as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Column -Type System.String[] -Mandatory:$false + It "Should have Column as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Column } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaReplDistributor.Tests.ps1 b/tests/Get-DbaReplDistributor.Tests.ps1 index a4d04ffbb0..c5b7f94e9d 100644 --- a/tests/Get-DbaReplDistributor.Tests.ps1 +++ b/tests/Get-DbaReplDistributor.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaReplDistributor" { $CommandUnderTest = Get-Command Get-DbaReplDistributor } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaReplPublication.Tests.ps1 b/tests/Get-DbaReplPublication.Tests.ps1 index 8e6d09950b..55ae9c8b70 100644 --- a/tests/Get-DbaReplPublication.Tests.ps1 +++ b/tests/Get-DbaReplPublication.Tests.ps1 @@ -10,22 +10,19 @@ Describe "Get-DbaReplPublication" { $CommandUnderTest = Get-Command Get-DbaReplPublication } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String -Mandatory:$false - } - It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Name -Type System.String } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch } } diff --git a/tests/Get-DbaReplPublisher.Tests.ps1 b/tests/Get-DbaReplPublisher.Tests.ps1 index 765220f2f3..e16ab115cf 100644 --- a/tests/Get-DbaReplPublisher.Tests.ps1 +++ b/tests/Get-DbaReplPublisher.Tests.ps1 @@ -11,13 +11,13 @@ Describe "Get-DbaReplPublisher" { $CommandUnderTest = Get-Command Get-DbaReplPublisher } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaReplServer.Tests.ps1 b/tests/Get-DbaReplServer.Tests.ps1 index fc79a76746..d3e57d8829 100644 --- a/tests/Get-DbaReplServer.Tests.ps1 +++ b/tests/Get-DbaReplServer.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbaReplServer" { $CommandUnderTest = Get-Command Get-DbaReplServer } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaReplSubscription.Tests.ps1 b/tests/Get-DbaReplSubscription.Tests.ps1 index 89d3cf05f7..b4f55ac887 100644 --- a/tests/Get-DbaReplSubscription.Tests.ps1 +++ b/tests/Get-DbaReplSubscription.Tests.ps1 @@ -11,28 +11,28 @@ Describe "Get-DbaReplSubscription" { $CommandUnderTest = Get-Command Get-DbaReplSubscription } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have PublicationName as a parameter" { - $CommandUnderTest | Should -HaveParameter PublicationName -Type System.String[] + $CommandUnderTest | Should -HaveParameter PublicationName } It "Should have SubscriberName as a parameter" { - $CommandUnderTest | Should -HaveParameter SubscriberName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SubscriberName } It "Should have SubscriptionDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter SubscriptionDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter SubscriptionDatabase } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Type } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaResourceGovernor.Tests.ps1 b/tests/Get-DbaResourceGovernor.Tests.ps1 index b0095f4e92..37597d96a4 100644 --- a/tests/Get-DbaResourceGovernor.Tests.ps1 +++ b/tests/Get-DbaResourceGovernor.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaResourceGovernor" { $CommandUnderTest = Get-Command Get-DbaResourceGovernor } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaRgClassifierFunction.Tests.ps1 b/tests/Get-DbaRgClassifierFunction.Tests.ps1 index 88f579e570..6232b1be6b 100644 --- a/tests/Get-DbaRgClassifierFunction.Tests.ps1 +++ b/tests/Get-DbaRgClassifierFunction.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Get-DbaRgClassifierFunction" { $CommandUnderTest = Get-Command Get-DbaRgClassifierFunction } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.ResourceGovernor[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaRgResourcePool.Tests.ps1 b/tests/Get-DbaRgResourcePool.Tests.ps1 index a55764b605..b2b31aad8f 100644 --- a/tests/Get-DbaRgResourcePool.Tests.ps1 +++ b/tests/Get-DbaRgResourcePool.Tests.ps1 @@ -15,9 +15,6 @@ Describe "Get-DbaRgResourcePool" { It "Should have SqlCredential as a parameter" { $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential } - It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String - } It "Should have InputObject as a parameter" { $CommandUnderTest | Should -HaveParameter InputObject -Type ResourceGovernor[] } diff --git a/tests/Get-DbaRgWorkloadGroup.Tests.ps1 b/tests/Get-DbaRgWorkloadGroup.Tests.ps1 index d749b5f3e3..b37770b619 100644 --- a/tests/Get-DbaRgWorkloadGroup.Tests.ps1 +++ b/tests/Get-DbaRgWorkloadGroup.Tests.ps1 @@ -5,17 +5,17 @@ Describe "Get-DbaRgWorkloadGroup" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaRgWorkloadGroup } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have InputObject as a non-mandatory parameter of type ResourcePool[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type ResourcePool[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaRunningJob.Tests.ps1 b/tests/Get-DbaRunningJob.Tests.ps1 index 632547aeea..a540402e66 100644 --- a/tests/Get-DbaRunningJob.Tests.ps1 +++ b/tests/Get-DbaRunningJob.Tests.ps1 @@ -5,17 +5,17 @@ Describe "Get-DbaRunningJob" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaRunningJob } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Agent.Job[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Agent.Job[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaSchemaChangeHistory.Tests.ps1 b/tests/Get-DbaSchemaChangeHistory.Tests.ps1 index fadda0464a..e7d42bc045 100644 --- a/tests/Get-DbaSchemaChangeHistory.Tests.ps1 +++ b/tests/Get-DbaSchemaChangeHistory.Tests.ps1 @@ -5,26 +5,26 @@ Describe "Get-DbaSchemaChangeHistory" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaSchemaChangeHistory } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have ExcludeDatabase as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + It "Should have ExcludeDatabase as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } - It "Should have Since as a non-mandatory parameter of type Dataplat.Dbatools.Utility.DbaDateTime" { - $CommandUnderTest | Should -HaveParameter Since -Type Dataplat.Dbatools.Utility.DbaDateTime -Mandatory:$false + It "Should have Since as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Since } - It "Should have Object as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Object -Type System.String[] -Mandatory:$false + It "Should have Object as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Object } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaServerRole.Tests.ps1 b/tests/Get-DbaServerRole.Tests.ps1 index 963d73fb3a..568acb9030 100644 --- a/tests/Get-DbaServerRole.Tests.ps1 +++ b/tests/Get-DbaServerRole.Tests.ps1 @@ -10,22 +10,22 @@ Describe "Get-DbaServerRole" { $CommandUnderTest = Get-Command Get-DbaServerRole } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have ServerRole parameter" { - $CommandUnderTest | Should -HaveParameter ServerRole -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ServerRole } It "Should have ExcludeServerRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeServerRole -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeServerRole } It "Should have ExcludeFixedRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeFixedRole -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeFixedRole } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaServerRoleMember.Tests.ps1 b/tests/Get-DbaServerRoleMember.Tests.ps1 index f72ab15e7e..646430c5c3 100644 --- a/tests/Get-DbaServerRoleMember.Tests.ps1 +++ b/tests/Get-DbaServerRoleMember.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Get-DbaServerRoleMember Unit Tests" -Tag "UnitTests" { $CommandUnderTest = Get-Command Get-DbaServerRoleMember } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have ServerRole as a parameter" { - $CommandUnderTest | Should -HaveParameter ServerRole -Type System.String[] + $CommandUnderTest | Should -HaveParameter ServerRole } It "Should have ExcludeServerRole as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeServerRole -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeServerRole } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Login } It "Should have ExcludeFixedRole as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeFixedRole -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeFixedRole } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaService.Tests.ps1 b/tests/Get-DbaService.Tests.ps1 index 0eab61e030..2f50db73ac 100644 --- a/tests/Get-DbaService.Tests.ps1 +++ b/tests/Get-DbaService.Tests.ps1 @@ -11,28 +11,28 @@ Describe "Get-DbaService" { $CommandUnderTest = Get-Command Get-DbaService } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have InstanceName as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter InstanceName -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InstanceName } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Type as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type } It "Should have ServiceName as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter ServiceName -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ServiceName } It "Should have AdvancedProperties as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter AdvancedProperties -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AdvancedProperties } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaSpConfigure.Tests.ps1 b/tests/Get-DbaSpConfigure.Tests.ps1 index cc219bfad8..5a596765e0 100644 --- a/tests/Get-DbaSpConfigure.Tests.ps1 +++ b/tests/Get-DbaSpConfigure.Tests.ps1 @@ -16,19 +16,19 @@ Describe "Get-DbaSpConfigure" { $CommandUnderTest = Get-Command Get-DbaSpConfigure } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Name } It "Should have ExcludeName as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeName -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeName } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaSpinLockStatistic.Tests.ps1 b/tests/Get-DbaSpinLockStatistic.Tests.ps1 index 12d0df4a1f..db608fc74c 100644 --- a/tests/Get-DbaSpinLockStatistic.Tests.ps1 +++ b/tests/Get-DbaSpinLockStatistic.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbaSpinLockStatistic" { $CommandUnderTest = Get-Command Get-DbaSpinLockStatistic } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaSpn.Tests.ps1 b/tests/Get-DbaSpn.Tests.ps1 index d43b2e14ed..617f5aea62 100644 --- a/tests/Get-DbaSpn.Tests.ps1 +++ b/tests/Get-DbaSpn.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Get-DbaSpn" { $CommandUnderTest = Get-Command Get-DbaSpn } It "Accepts ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName } It "Accepts AccountName as a parameter" { - $CommandUnderTest | Should -HaveParameter AccountName -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AccountName } It "Accepts Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Accepts EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaSsisEnvironmentVariable.Tests.ps1 b/tests/Get-DbaSsisEnvironmentVariable.Tests.ps1 index bbb00ac057..84365b23b9 100644 --- a/tests/Get-DbaSsisEnvironmentVariable.Tests.ps1 +++ b/tests/Get-DbaSsisEnvironmentVariable.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Get-DbaSsisEnvironmentVariable" { $CommandUnderTest = Get-Command Get-DbaSsisEnvironmentVariable } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Environment as a parameter" { - $CommandUnderTest | Should -HaveParameter Environment -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Environment } It "Should have EnvironmentExclude as a parameter" { - $CommandUnderTest | Should -HaveParameter EnvironmentExclude -Type System.Object[] + $CommandUnderTest | Should -HaveParameter EnvironmentExclude } It "Should have Folder as a parameter" { - $CommandUnderTest | Should -HaveParameter Folder -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Folder } It "Should have FolderExclude as a parameter" { - $CommandUnderTest | Should -HaveParameter FolderExclude -Type System.Object[] + $CommandUnderTest | Should -HaveParameter FolderExclude } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaSsisExecutionHistory.Tests.ps1 b/tests/Get-DbaSsisExecutionHistory.Tests.ps1 index 0449405043..9b1eba1bd4 100644 --- a/tests/Get-DbaSsisExecutionHistory.Tests.ps1 +++ b/tests/Get-DbaSsisExecutionHistory.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Get-DbaSsisExecutionHistory" { $CommandUnderTest = Get-Command Get-DbaSsisExecutionHistory } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Since as a parameter" { - $CommandUnderTest | Should -HaveParameter Since -Type System.DateTime + $CommandUnderTest | Should -HaveParameter Since } It "Should have Status as a parameter" { - $CommandUnderTest | Should -HaveParameter Status -Type System.String[] + $CommandUnderTest | Should -HaveParameter Status } It "Should have Project as a parameter" { - $CommandUnderTest | Should -HaveParameter Project -Type System.String[] + $CommandUnderTest | Should -HaveParameter Project } It "Should have Folder as a parameter" { - $CommandUnderTest | Should -HaveParameter Folder -Type System.String[] + $CommandUnderTest | Should -HaveParameter Folder } It "Should have Environment as a parameter" { - $CommandUnderTest | Should -HaveParameter Environment -Type System.String[] + $CommandUnderTest | Should -HaveParameter Environment } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaStartupParameter.Tests.ps1 b/tests/Get-DbaStartupParameter.Tests.ps1 index 07d29c654a..1a8ab63c0a 100644 --- a/tests/Get-DbaStartupParameter.Tests.ps1 +++ b/tests/Get-DbaStartupParameter.Tests.ps1 @@ -9,17 +9,17 @@ Describe "Get-DbaStartupParameter" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaStartupParameter } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Simple as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Simple -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Simple } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaStartupProcedure.Tests.ps1 b/tests/Get-DbaStartupProcedure.Tests.ps1 index 784cb6b495..ac15a1f4b9 100644 --- a/tests/Get-DbaStartupProcedure.Tests.ps1 +++ b/tests/Get-DbaStartupProcedure.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Get-DbaStartupProcedure" { $CommandUnderTest = Get-Command Get-DbaStartupProcedure } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have StartupProcedure as a parameter" { - $CommandUnderTest | Should -HaveParameter StartupProcedure -Type System.String[] + $CommandUnderTest | Should -HaveParameter StartupProcedure } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaSuspectPage.Tests.ps1 b/tests/Get-DbaSuspectPage.Tests.ps1 index ed89ce6309..975907a4e3 100644 --- a/tests/Get-DbaSuspectPage.Tests.ps1 +++ b/tests/Get-DbaSuspectPage.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Get-DbaSuspectPage" { $CommandUnderTest = Get-Command Get-DbaSuspectPage } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object + $CommandUnderTest | Should -HaveParameter Database } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -34,14 +34,14 @@ Describe "Get-DbaSuspectPage" { # make darn sure suspect pages show up, run twice try { - $null = Invoke-DbaDbCorruption -SqlInstance $global:instance2 -Database $dbname -Confirm:$false + $null = Invoke-DbaDbCorruption -SqlInstance $global:instance2 -Database $dbname $null = $db.Query("select top 100 from example") $null = $server.Query("ALTER DATABASE $dbname SET PAGE_VERIFY CHECKSUM WITH NO_WAIT") $null = Start-DbccCheck -Server $Server -dbname $dbname -WarningAction SilentlyContinue } catch {} # should fail try { - $null = Invoke-DbaDbCorruption -SqlInstance $global:instance2 -Database $dbname -Confirm:$false + $null = Invoke-DbaDbCorruption -SqlInstance $global:instance2 -Database $dbname $null = $db.Query("select top 100 from example") $null = $server.Query("ALTER DATABASE $dbname SET PAGE_VERIFY CHECKSUM WITH NO_WAIT") $null = Start-DbccCheck -Server $Server -dbname $dbname -WarningAction SilentlyContinue diff --git a/tests/Get-DbaTcpPort.Tests.ps1 b/tests/Get-DbaTcpPort.Tests.ps1 index 866b70ff26..356092fb65 100644 --- a/tests/Get-DbaTcpPort.Tests.ps1 +++ b/tests/Get-DbaTcpPort.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Get-DbaTcpPort" { $CommandUnderTest = Get-Command Get-DbaTcpPort } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have All as a switch parameter" { - $CommandUnderTest | Should -HaveParameter All -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter All } It "Should have ExcludeIpv6 as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeIpv6 -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeIpv6 } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaTempdbUsage.Tests.ps1 b/tests/Get-DbaTempdbUsage.Tests.ps1 index 38ed15f6c2..01484edcbc 100644 --- a/tests/Get-DbaTempdbUsage.Tests.ps1 +++ b/tests/Get-DbaTempdbUsage.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbaTempdbUsage" { $CommandUnderTest = Get-Command Get-DbaTempdbUsage } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaTopResourceUsage.Tests.ps1 b/tests/Get-DbaTopResourceUsage.Tests.ps1 index d164fc3c66..470719f2b3 100644 --- a/tests/Get-DbaTopResourceUsage.Tests.ps1 +++ b/tests/Get-DbaTopResourceUsage.Tests.ps1 @@ -5,29 +5,29 @@ Describe "Get-DbaTopResourceUsage" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaTopResourceUsage } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance -Mandatory:$false } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential -Mandatory:$false } - It "Should have Database as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database -Mandatory:$false } - It "Should have ExcludeDatabase as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + It "Should have ExcludeDatabase as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Mandatory:$false } - It "Should have Type as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] -Mandatory:$false + It "Should have Type as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Type -Mandatory:$false } - It "Should have Limit as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter Limit -Type System.Int32 -Mandatory:$false + It "Should have Limit as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Limit -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException -Mandatory:$false } It "Should have ExcludeSystem as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystem -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeSystem -Mandatory:$false } } diff --git a/tests/Get-DbaTrace.Tests.ps1 b/tests/Get-DbaTrace.Tests.ps1 index c610ff84f1..c6d2809d7f 100644 --- a/tests/Get-DbaTrace.Tests.ps1 +++ b/tests/Get-DbaTrace.Tests.ps1 @@ -35,19 +35,19 @@ Describe "Get-DbaTrace" { $CommandUnderTest = Get-Command Get-DbaTrace } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Id as a parameter" { - $CommandUnderTest | Should -HaveParameter Id -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter Id } It "Should have Default as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Default -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Default } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaTraceFlag.Tests.ps1 b/tests/Get-DbaTraceFlag.Tests.ps1 index 4462e398bc..e14385a404 100644 --- a/tests/Get-DbaTraceFlag.Tests.ps1 +++ b/tests/Get-DbaTraceFlag.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Get-DbaTraceFlag" { $CommandUnderTest = Get-Command Get-DbaTraceFlag } It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have TraceFlag as a non-mandatory parameter of type System.Int32[]" { - $CommandUnderTest | Should -HaveParameter TraceFlag -Type System.Int32[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter TraceFlag } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaUpTime.Tests.ps1 b/tests/Get-DbaUpTime.Tests.ps1 index c555692c65..05f32f492b 100644 --- a/tests/Get-DbaUpTime.Tests.ps1 +++ b/tests/Get-DbaUpTime.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Get-DbaUptime" { $CommandUnderTest = Get-Command Get-DbaUptime } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaUserPermission.Tests.ps1 b/tests/Get-DbaUserPermission.Tests.ps1 index ceb3830450..9de463bd9b 100644 --- a/tests/Get-DbaUserPermission.Tests.ps1 +++ b/tests/Get-DbaUserPermission.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Get-DbaUserPermission Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaUserPermission } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have ExcludeSystemDatabase as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemDatabase -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeSystemDatabase } It "Should have IncludePublicGuest as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludePublicGuest -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludePublicGuest } It "Should have IncludeSystemObjects as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemObjects -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSystemObjects } It "Should have ExcludeSecurables as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSecurables -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeSecurables } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaWaitResource.Tests.ps1 b/tests/Get-DbaWaitResource.Tests.ps1 index 6b6f7153f8..5dfc092ef8 100644 --- a/tests/Get-DbaWaitResource.Tests.ps1 +++ b/tests/Get-DbaWaitResource.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Get-DbaWaitResource" { $CommandUnderTest = Get-Command Get-DbaWaitResource } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have WaitResource parameter" { - $CommandUnderTest | Should -HaveParameter WaitResource -Type System.String + $CommandUnderTest | Should -HaveParameter WaitResource } It "Should have Row parameter" { - $CommandUnderTest | Should -HaveParameter Row -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Row } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaWaitStatistic.Tests.ps1 b/tests/Get-DbaWaitStatistic.Tests.ps1 index e30513984b..94912836d3 100644 --- a/tests/Get-DbaWaitStatistic.Tests.ps1 +++ b/tests/Get-DbaWaitStatistic.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Get-DbaWaitStatistic" { $CommandUnderTest = Get-Command Get-DbaWaitStatistic } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Threshold as a parameter" { - $CommandUnderTest | Should -HaveParameter Threshold -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Threshold } It "Should have IncludeIgnorable as a parameter" { - $CommandUnderTest | Should -HaveParameter IncludeIgnorable -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeIgnorable } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaWaitingTask.Tests.ps1 b/tests/Get-DbaWaitingTask.Tests.ps1 index 148bee5ae1..f8c2d21581 100644 --- a/tests/Get-DbaWaitingTask.Tests.ps1 +++ b/tests/Get-DbaWaitingTask.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Get-DbaWaitingTask" { $CommandUnderTest = Get-Command Get-DbaWaitingTask } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Spid as a parameter" { - $CommandUnderTest | Should -HaveParameter Spid -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Spid } It "Should have IncludeSystemSpid as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemSpid -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSystemSpid } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaWindowsLog.Tests.ps1 b/tests/Get-DbaWindowsLog.Tests.ps1 index 1d943c90ae..b827e12a65 100644 --- a/tests/Get-DbaWindowsLog.Tests.ps1 +++ b/tests/Get-DbaWindowsLog.Tests.ps1 @@ -12,25 +12,25 @@ Describe "Get-DbaWindowsLog" { $CommandUnderTest = Get-Command Get-DbaWindowsLog } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Start as a parameter" { - $CommandUnderTest | Should -HaveParameter Start -Type System.DateTime + $CommandUnderTest | Should -HaveParameter Start } It "Should have End as a parameter" { - $CommandUnderTest | Should -HaveParameter End -Type System.DateTime + $CommandUnderTest | Should -HaveParameter End } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have MaxThreads as a parameter" { - $CommandUnderTest | Should -HaveParameter MaxThreads -Type System.Int32 + $CommandUnderTest | Should -HaveParameter MaxThreads } It "Should have MaxRemoteThreads as a parameter" { - $CommandUnderTest | Should -HaveParameter MaxRemoteThreads -Type System.Int32 + $CommandUnderTest | Should -HaveParameter MaxRemoteThreads } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaWsfcAvailableDisk.Tests.ps1 b/tests/Get-DbaWsfcAvailableDisk.Tests.ps1 index e30fb5e2d7..2e30085bbe 100644 --- a/tests/Get-DbaWsfcAvailableDisk.Tests.ps1 +++ b/tests/Get-DbaWsfcAvailableDisk.Tests.ps1 @@ -11,14 +11,14 @@ Describe "Get-DbaWsfcAvailableDisk" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaWsfcAvailableDisk } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaWsfcCluster.Tests.ps1 b/tests/Get-DbaWsfcCluster.Tests.ps1 index 113c10230c..92d619d2f4 100644 --- a/tests/Get-DbaWsfcCluster.Tests.ps1 +++ b/tests/Get-DbaWsfcCluster.Tests.ps1 @@ -10,13 +10,13 @@ Describe "Get-DbaWsfcCluster" { $CommandUnderTest = Get-Command Get-DbaWsfcCluster } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaWsfcDisk.Tests.ps1 b/tests/Get-DbaWsfcDisk.Tests.ps1 index 33466105c1..2833896bff 100644 --- a/tests/Get-DbaWsfcDisk.Tests.ps1 +++ b/tests/Get-DbaWsfcDisk.Tests.ps1 @@ -11,14 +11,14 @@ Describe "Get-DbaWsfcDisk" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaWsfcDisk } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaWsfcNetwork.Tests.ps1 b/tests/Get-DbaWsfcNetwork.Tests.ps1 index 3cef8c0999..0d62e5db4d 100644 --- a/tests/Get-DbaWsfcNetwork.Tests.ps1 +++ b/tests/Get-DbaWsfcNetwork.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaWsfcNetwork" { $CommandUnderTest = Get-Command Get-DbaWsfcNetwork } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaWsfcNetworkInterface.Tests.ps1 b/tests/Get-DbaWsfcNetworkInterface.Tests.ps1 index a4e95c4f55..c80e58d482 100644 --- a/tests/Get-DbaWsfcNetworkInterface.Tests.ps1 +++ b/tests/Get-DbaWsfcNetworkInterface.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbaWsfcNetworkInterface" { $CommandUnderTest = Get-Command Get-DbaWsfcNetworkInterface } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaWsfcNode.Tests.ps1 b/tests/Get-DbaWsfcNode.Tests.ps1 index 2a2d8bbf6d..9f940d71ab 100644 --- a/tests/Get-DbaWsfcNode.Tests.ps1 +++ b/tests/Get-DbaWsfcNode.Tests.ps1 @@ -5,14 +5,14 @@ Describe "Get-DbaWsfcNode" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaWsfcNode } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaWsfcResource.Tests.ps1 b/tests/Get-DbaWsfcResource.Tests.ps1 index 85a6476d6a..ceed0f018e 100644 --- a/tests/Get-DbaWsfcResource.Tests.ps1 +++ b/tests/Get-DbaWsfcResource.Tests.ps1 @@ -11,14 +11,14 @@ Describe "Get-DbaWsfcResource" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaWsfcResource } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaWsfcResourceGroup.Tests.ps1 b/tests/Get-DbaWsfcResourceGroup.Tests.ps1 index 93c306a567..27ec35fb7c 100644 --- a/tests/Get-DbaWsfcResourceGroup.Tests.ps1 +++ b/tests/Get-DbaWsfcResourceGroup.Tests.ps1 @@ -9,17 +9,17 @@ Describe "Get-DbaWsfcResourceGroup" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaWsfcResourceGroup } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } - It "Should have Name as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] -Mandatory:$false + It "Should have Name as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Name } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaWsfcResourceType.Tests.ps1 b/tests/Get-DbaWsfcResourceType.Tests.ps1 index ceb65ef7d5..cb2f9cceb0 100644 --- a/tests/Get-DbaWsfcResourceType.Tests.ps1 +++ b/tests/Get-DbaWsfcResourceType.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaWsfcResourceType" { $CommandUnderTest = Get-Command Get-DbaWsfcResourceType } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaWsfcRole.Tests.ps1 b/tests/Get-DbaWsfcRole.Tests.ps1 index 154dc6319f..f0d8ad95ad 100644 --- a/tests/Get-DbaWsfcRole.Tests.ps1 +++ b/tests/Get-DbaWsfcRole.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbaWsfcRole" { $CommandUnderTest = Get-Command Get-DbaWsfcRole } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaWsfcSharedVolume.Tests.ps1 b/tests/Get-DbaWsfcSharedVolume.Tests.ps1 index 75bd653c81..1cd17e2aa0 100644 --- a/tests/Get-DbaWsfcSharedVolume.Tests.ps1 +++ b/tests/Get-DbaWsfcSharedVolume.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbaWsfcSharedVolume" { $CommandUnderTest = Get-Command Get-DbaWsfcSharedVolume } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaXEObject.Tests.ps1 b/tests/Get-DbaXEObject.Tests.ps1 index 0db5ed19d1..9e863a0d69 100644 --- a/tests/Get-DbaXEObject.Tests.ps1 +++ b/tests/Get-DbaXEObject.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Get-DbaXEObject" { $CommandUnderTest = Get-Command Get-DbaXEObject } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] + $CommandUnderTest | Should -HaveParameter Type } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaXESession.Tests.ps1 b/tests/Get-DbaXESession.Tests.ps1 index ee7f8fc8de..8c5e13fe18 100644 --- a/tests/Get-DbaXESession.Tests.ps1 +++ b/tests/Get-DbaXESession.Tests.ps1 @@ -9,17 +9,17 @@ Describe "Get-DbaXESession" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaXESession } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Session as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Session -Type System.Object[] -Mandatory:$false + It "Should have Session as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Session } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaXESessionTarget.Tests.ps1 b/tests/Get-DbaXESessionTarget.Tests.ps1 index 1bfd563eb5..4907a6a401 100644 --- a/tests/Get-DbaXESessionTarget.Tests.ps1 +++ b/tests/Get-DbaXESessionTarget.Tests.ps1 @@ -5,23 +5,23 @@ Describe "Get-DbaXESessionTarget" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaXESessionTarget } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Session as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Session -Type System.String[] -Mandatory:$false + It "Should have Session as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Session } - It "Should have Target as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Target -Type System.String[] -Mandatory:$false + It "Should have Target as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Target } - It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.XEvent.Session[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.XEvent.Session[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaXESessionTargetFile.Tests.ps1 b/tests/Get-DbaXESessionTargetFile.Tests.ps1 index 2ca9eb8f76..bf489992f2 100644 --- a/tests/Get-DbaXESessionTargetFile.Tests.ps1 +++ b/tests/Get-DbaXESessionTargetFile.Tests.ps1 @@ -14,22 +14,22 @@ Describe "Get-DbaXESessionTargetFile" { $CommandUnderTest = Get-Command Get-DbaXESessionTargetFile } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Session as a parameter" { - $CommandUnderTest | Should -HaveParameter Session -Type System.String[] + $CommandUnderTest | Should -HaveParameter Session } It "Should have Target as a parameter" { - $CommandUnderTest | Should -HaveParameter Target -Type System.String[] + $CommandUnderTest | Should -HaveParameter Target } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.XEvent.Target[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaXESessionTemplate.Tests.ps1 b/tests/Get-DbaXESessionTemplate.Tests.ps1 index 51298db281..e9c6081bb9 100644 --- a/tests/Get-DbaXESessionTemplate.Tests.ps1 +++ b/tests/Get-DbaXESessionTemplate.Tests.ps1 @@ -11,17 +11,17 @@ Describe "Get-DbaXESessionTemplate" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaXESessionTemplate } - It "Should have Path as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String[] -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } - It "Should have Pattern as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Pattern -Type System.String -Mandatory:$false + It "Should have Pattern as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Pattern } - It "Should have Template as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter Template -Type System.String[] -Mandatory:$false + It "Should have Template as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Template } - It "Should have EnableException as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have EnableException as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbaXESmartTarget.Tests.ps1 b/tests/Get-DbaXESmartTarget.Tests.ps1 index b77b25dcf0..b0ebd2c752 100644 --- a/tests/Get-DbaXESmartTarget.Tests.ps1 +++ b/tests/Get-DbaXESmartTarget.Tests.ps1 @@ -5,8 +5,8 @@ Describe "Get-DbaXESmartTarget" { BeforeAll { $CommandUnderTest = Get-Command Get-DbaXESmartTarget } - It "Should have EnableException as a Switch that is not mandatory" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have EnableException as a Switch" { + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbaXEStore.Tests.ps1 b/tests/Get-DbaXEStore.Tests.ps1 index 261a7693d8..6f1fca5d30 100644 --- a/tests/Get-DbaXEStore.Tests.ps1 +++ b/tests/Get-DbaXEStore.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbaXEStore" { $CommandUnderTest = Get-Command Get-DbaXEStore } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Get-DbatoolsChangeLog.Tests.ps1 b/tests/Get-DbatoolsChangeLog.Tests.ps1 index 45f31c94f8..36b8999854 100644 --- a/tests/Get-DbatoolsChangeLog.Tests.ps1 +++ b/tests/Get-DbatoolsChangeLog.Tests.ps1 @@ -6,10 +6,10 @@ Describe "Get-DbatoolsChangeLog" { $CommandUnderTest = Get-Command Get-DbatoolsChangeLog } It "Should have Local as a Switch" { - $CommandUnderTest | Should -HaveParameter Local -Type switch + $CommandUnderTest | Should -HaveParameter Local } It "Should have EnableException as a Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-DbatoolsConfig.Tests.ps1 b/tests/Get-DbatoolsConfig.Tests.ps1 index 267ada9c63..13e10edfff 100644 --- a/tests/Get-DbatoolsConfig.Tests.ps1 +++ b/tests/Get-DbatoolsConfig.Tests.ps1 @@ -5,17 +5,17 @@ Describe "Get-DbatoolsConfig" { BeforeAll { $CommandUnderTest = Get-Command Get-DbatoolsConfig } - It "Should have parameter FullName of type System.String" { - $CommandUnderTest | Should -HaveParameter FullName -Type System.String -Mandatory:$false + It "Should have parameter FullName" { + $CommandUnderTest | Should -HaveParameter FullName } - It "Should have parameter Name of type System.String" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String -Mandatory:$false + It "Should have parameter Name" { + $CommandUnderTest | Should -HaveParameter Name } - It "Should have parameter Module of type System.String" { - $CommandUnderTest | Should -HaveParameter Module -Type System.String -Mandatory:$false + It "Should have parameter Module" { + $CommandUnderTest | Should -HaveParameter Module } - It "Should have parameter Force of type System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have parameter Force" { + $CommandUnderTest | Should -HaveParameter Force } } diff --git a/tests/Get-DbatoolsConfigValue.Tests.ps1 b/tests/Get-DbatoolsConfigValue.Tests.ps1 index 5665d71b71..e22bd48d53 100644 --- a/tests/Get-DbatoolsConfigValue.Tests.ps1 +++ b/tests/Get-DbatoolsConfigValue.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Get-DbatoolsConfigValue" { $CommandUnderTest = Get-Command Get-DbatoolsConfigValue } It "Should have FullName as a parameter" { - $CommandUnderTest | Should -HaveParameter FullName -Type System.String + $CommandUnderTest | Should -HaveParameter FullName } It "Should have Fallback as a parameter" { - $CommandUnderTest | Should -HaveParameter Fallback -Type System.Object + $CommandUnderTest | Should -HaveParameter Fallback } It "Should have NotNull as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NotNull -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NotNull } } diff --git a/tests/Get-DbatoolsError.Tests.ps1 b/tests/Get-DbatoolsError.Tests.ps1 index f2db6ed357..071c694765 100644 --- a/tests/Get-DbatoolsError.Tests.ps1 +++ b/tests/Get-DbatoolsError.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Get-DbatoolsError" { $CommandUnderTest = Get-Command Get-DbatoolsError } It "Accepts First as a parameter" { - $CommandUnderTest | Should -HaveParameter First -Type System.Int32 + $CommandUnderTest | Should -HaveParameter First } It "Accepts Last as a parameter" { - $CommandUnderTest | Should -HaveParameter Last -Type System.Int32 + $CommandUnderTest | Should -HaveParameter Last } It "Accepts Skip as a parameter" { - $CommandUnderTest | Should -HaveParameter Skip -Type System.Int32 + $CommandUnderTest | Should -HaveParameter Skip } It "Accepts All as a parameter" { - $CommandUnderTest | Should -HaveParameter All -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter All } } diff --git a/tests/Get-DbatoolsLog.Tests.ps1 b/tests/Get-DbatoolsLog.Tests.ps1 index d4a6058b9a..154e70c389 100644 --- a/tests/Get-DbatoolsLog.Tests.ps1 +++ b/tests/Get-DbatoolsLog.Tests.ps1 @@ -9,38 +9,38 @@ Describe "Get-DbatoolsLog" { BeforeAll { $CommandUnderTest = Get-Command Get-DbatoolsLog } - It "Should have FunctionName as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter FunctionName -Type System.String -Mandatory:$false + It "Should have FunctionName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter FunctionName } - It "Should have ModuleName as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter ModuleName -Type System.String -Mandatory:$false + It "Should have ModuleName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ModuleName } - It "Should have Target as a non-mandatory System.Object parameter" { - $CommandUnderTest | Should -HaveParameter Target -Type System.Object -Mandatory:$false + It "Should have Target as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Target } - It "Should have Tag as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter Tag -Type System.String[] -Mandatory:$false + It "Should have Tag as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Tag } - It "Should have Last as a non-mandatory System.Int32 parameter" { - $CommandUnderTest | Should -HaveParameter Last -Type System.Int32 -Mandatory:$false + It "Should have Last as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Last } - It "Should have LastError as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter LastError -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have LastError as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter LastError } - It "Should have Skip as a non-mandatory System.Int32 parameter" { - $CommandUnderTest | Should -HaveParameter Skip -Type System.Int32 -Mandatory:$false + It "Should have Skip as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Skip } - It "Should have Runspace as a non-mandatory System.Guid parameter" { - $CommandUnderTest | Should -HaveParameter Runspace -Type System.Guid -Mandatory:$false + It "Should have Runspace as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Runspace } - It "Should have Level as a non-mandatory Dataplat.Dbatools.Message.MessageLevel[] parameter" { - $CommandUnderTest | Should -HaveParameter Level -Type Dataplat.Dbatools.Message.MessageLevel[] -Mandatory:$false + It "Should have Level as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Level } - It "Should have Raw as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter Raw -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have Raw as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Raw } - It "Should have Errors as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter Errors -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have Errors as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Errors } } diff --git a/tests/Get-DbatoolsPath.Tests.ps1 b/tests/Get-DbatoolsPath.Tests.ps1 index 3432d8ba4a..3726798c11 100644 --- a/tests/Get-DbatoolsPath.Tests.ps1 +++ b/tests/Get-DbatoolsPath.Tests.ps1 @@ -10,7 +10,7 @@ Describe "Get-DbatoolsPath" { $CommandUnderTest = Get-Command Get-DbatoolsPath } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String + $CommandUnderTest | Should -HaveParameter Name } } } diff --git a/tests/Get-DirectoryRestoreFile.Tests.ps1 b/tests/Get-DirectoryRestoreFile.Tests.ps1 index 8074237981..ecce44568c 100644 --- a/tests/Get-DirectoryRestoreFile.Tests.ps1 +++ b/tests/Get-DirectoryRestoreFile.Tests.ps1 @@ -11,13 +11,13 @@ Describe "Get-DirectoryRestoreFile" { $CommandUnderTest = Get-Command Get-DirectoryRestoreFile } It "Should have Path as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have Recurse as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter Recurse -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Recurse } It "Should have EnableException as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Get-ObjectNameParts.Tests.ps1 b/tests/Get-ObjectNameParts.Tests.ps1 index 7d66dd9e81..23b9605f73 100644 --- a/tests/Get-ObjectNameParts.Tests.ps1 +++ b/tests/Get-ObjectNameParts.Tests.ps1 @@ -10,8 +10,8 @@ Describe "Get-ObjectNameParts" { BeforeAll { $CommandUnderTest = Get-Command Get-ObjectNameParts } - It "Should have ObjectName as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter ObjectName -Type System.String -Mandatory:$false + It "Should have ObjectName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ObjectName } } diff --git a/tests/Get-SqlDefaultSpConfigure.Tests.ps1 b/tests/Get-SqlDefaultSpConfigure.Tests.ps1 index c29a4c220f..8b6a6c4fd8 100644 --- a/tests/Get-SqlDefaultSpConfigure.Tests.ps1 +++ b/tests/Get-SqlDefaultSpConfigure.Tests.ps1 @@ -10,8 +10,8 @@ Describe "Get-SqlDefaultSPConfigure" { BeforeAll { $CommandUnderTest = Get-Command Get-SqlDefaultSPConfigure } - It "Should have SqlVersion as a non-mandatory parameter of type System.Object" { - $CommandUnderTest | Should -HaveParameter SqlVersion -Type System.Object -Mandatory:$false + It "Should have SqlVersion as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlVersion } } diff --git a/tests/Get-XpDirTreeRestoreFile.Tests.ps1 b/tests/Get-XpDirTreeRestoreFile.Tests.ps1 index ad9ddfa50a..c58197cfb3 100644 --- a/tests/Get-XpDirTreeRestoreFile.Tests.ps1 +++ b/tests/Get-XpDirTreeRestoreFile.Tests.ps1 @@ -10,19 +10,19 @@ Describe "Get-XpDirTreeRestoreFile" { $CommandUnderTest = Get-Command Get-XpDirTreeRestoreFile } It "Should have Path as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have SqlInstance as a non-mandatory DbaInstanceParameter parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have NoRecurse as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter NoRecurse -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoRecurse } } diff --git a/tests/Grant-DbaAgPermission.Tests.ps1 b/tests/Grant-DbaAgPermission.Tests.ps1 index b10f1cc2b0..3d34601997 100644 --- a/tests/Grant-DbaAgPermission.Tests.ps1 +++ b/tests/Grant-DbaAgPermission.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Grant-DbaAgPermission" { $CommandUnderTest = Get-Command Grant-DbaAgPermission } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type Microsoft.SqlServer.Management.Smo.Login[] + $CommandUnderTest | Should -HaveParameter Login } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String[] + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] + $CommandUnderTest | Should -HaveParameter Type } It "Should have Permission as a parameter" { - $CommandUnderTest | Should -HaveParameter Permission -Type System.String[] + $CommandUnderTest | Should -HaveParameter Permission } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Login[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Import-DbaBinaryFile.Tests.ps1 b/tests/Import-DbaBinaryFile.Tests.ps1 index 71894f81cc..a7e7dec13b 100644 --- a/tests/Import-DbaBinaryFile.Tests.ps1 +++ b/tests/Import-DbaBinaryFile.Tests.ps1 @@ -23,43 +23,43 @@ Describe "Import-DbaBinaryFile" { $CommandUnderTest = Get-Command Import-DbaBinaryFile } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have Table as a parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String + $CommandUnderTest | Should -HaveParameter Table } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String + $CommandUnderTest | Should -HaveParameter Schema } It "Should have Statement as a parameter" { - $CommandUnderTest | Should -HaveParameter Statement -Type System.String + $CommandUnderTest | Should -HaveParameter Statement } It "Should have FileNameColumn as a parameter" { - $CommandUnderTest | Should -HaveParameter FileNameColumn -Type System.String + $CommandUnderTest | Should -HaveParameter FileNameColumn } It "Should have BinaryColumn as a parameter" { - $CommandUnderTest | Should -HaveParameter BinaryColumn -Type System.String + $CommandUnderTest | Should -HaveParameter BinaryColumn } It "Should have NoFileNameColumn as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoFileNameColumn -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoFileNameColumn } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type [Microsoft.SqlServer.Management.Smo.Table[]] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have FilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.IO.FileInfo[] + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.IO.FileInfo[] + $CommandUnderTest | Should -HaveParameter Path } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Import-DbaCsv.Tests.ps1 b/tests/Import-DbaCsv.Tests.ps1 index e2df30e8d5..71dd91cab4 100644 --- a/tests/Import-DbaCsv.Tests.ps1 +++ b/tests/Import-DbaCsv.Tests.ps1 @@ -22,115 +22,115 @@ Describe "Import-DbaCsv" { $CommandUnderTest = Get-Command Import-DbaCsv } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Table parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Table } It "Should have Schema parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Schema } It "Should have Truncate parameter" { - $CommandUnderTest | Should -HaveParameter Truncate -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Truncate } It "Should have Delimiter parameter" { - $CommandUnderTest | Should -HaveParameter Delimiter -Type System.Char -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Delimiter } It "Should have SingleColumn parameter" { - $CommandUnderTest | Should -HaveParameter SingleColumn -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter SingleColumn } It "Should have BatchSize parameter" { - $CommandUnderTest | Should -HaveParameter BatchSize -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter BatchSize } It "Should have NotifyAfter parameter" { - $CommandUnderTest | Should -HaveParameter NotifyAfter -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NotifyAfter } It "Should have TableLock parameter" { - $CommandUnderTest | Should -HaveParameter TableLock -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter TableLock } It "Should have CheckConstraints parameter" { - $CommandUnderTest | Should -HaveParameter CheckConstraints -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter CheckConstraints } It "Should have FireTriggers parameter" { - $CommandUnderTest | Should -HaveParameter FireTriggers -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter FireTriggers } It "Should have KeepIdentity parameter" { - $CommandUnderTest | Should -HaveParameter KeepIdentity -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter KeepIdentity } It "Should have KeepNulls parameter" { - $CommandUnderTest | Should -HaveParameter KeepNulls -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter KeepNulls } It "Should have Column parameter" { - $CommandUnderTest | Should -HaveParameter Column -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Column } It "Should have ColumnMap parameter" { - $CommandUnderTest | Should -HaveParameter ColumnMap -Type System.Collections.Hashtable -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ColumnMap } It "Should have KeepOrdinalOrder parameter" { - $CommandUnderTest | Should -HaveParameter KeepOrdinalOrder -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter KeepOrdinalOrder } It "Should have AutoCreateTable parameter" { - $CommandUnderTest | Should -HaveParameter AutoCreateTable -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AutoCreateTable } It "Should have NoProgress parameter" { - $CommandUnderTest | Should -HaveParameter NoProgress -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoProgress } It "Should have NoHeaderRow parameter" { - $CommandUnderTest | Should -HaveParameter NoHeaderRow -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoHeaderRow } It "Should have UseFileNameForSchema parameter" { - $CommandUnderTest | Should -HaveParameter UseFileNameForSchema -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter UseFileNameForSchema } It "Should have Quote parameter" { - $CommandUnderTest | Should -HaveParameter Quote -Type System.Char -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Quote } It "Should have Escape parameter" { - $CommandUnderTest | Should -HaveParameter Escape -Type System.Char -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Escape } It "Should have Comment parameter" { - $CommandUnderTest | Should -HaveParameter Comment -Type System.Char -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Comment } It "Should have TrimmingOption parameter" { - $CommandUnderTest | Should -HaveParameter TrimmingOption -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter TrimmingOption } It "Should have BufferSize parameter" { - $CommandUnderTest | Should -HaveParameter BufferSize -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter BufferSize } It "Should have ParseErrorAction parameter" { - $CommandUnderTest | Should -HaveParameter ParseErrorAction -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ParseErrorAction } It "Should have Encoding parameter" { - $CommandUnderTest | Should -HaveParameter Encoding -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Encoding } It "Should have NullValue parameter" { - $CommandUnderTest | Should -HaveParameter NullValue -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NullValue } It "Should have MaxQuotedFieldLength parameter" { - $CommandUnderTest | Should -HaveParameter MaxQuotedFieldLength -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaxQuotedFieldLength } It "Should have SkipEmptyLine parameter" { - $CommandUnderTest | Should -HaveParameter SkipEmptyLine -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter SkipEmptyLine } It "Should have SupportsMultiline parameter" { - $CommandUnderTest | Should -HaveParameter SupportsMultiline -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter SupportsMultiline } It "Should have UseColumnDefault parameter" { - $CommandUnderTest | Should -HaveParameter UseColumnDefault -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter UseColumnDefault } It "Should have NoTransaction parameter" { - $CommandUnderTest | Should -HaveParameter NoTransaction -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoTransaction } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Import-DbaPfDataCollectorSetTemplate.Tests.ps1 b/tests/Import-DbaPfDataCollectorSetTemplate.Tests.ps1 index 61ff197624..cd0378d5c0 100644 --- a/tests/Import-DbaPfDataCollectorSetTemplate.Tests.ps1 +++ b/tests/Import-DbaPfDataCollectorSetTemplate.Tests.ps1 @@ -6,64 +6,64 @@ Describe "Import-DbaPfDataCollectorSetTemplate" { $CommandUnderTest = Get-Command Import-DbaPfDataCollectorSetTemplate } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have DisplayName as a parameter" { - $CommandUnderTest | Should -HaveParameter DisplayName -Type System.String + $CommandUnderTest | Should -HaveParameter DisplayName } It "Should have SchedulesEnabled as a switch parameter" { - $CommandUnderTest | Should -HaveParameter SchedulesEnabled -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter SchedulesEnabled } It "Should have RootPath as a parameter" { - $CommandUnderTest | Should -HaveParameter RootPath -Type System.String + $CommandUnderTest | Should -HaveParameter RootPath } It "Should have Segment as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Segment -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Segment } It "Should have SegmentMaxDuration as a parameter" { - $CommandUnderTest | Should -HaveParameter SegmentMaxDuration -Type System.Int32 + $CommandUnderTest | Should -HaveParameter SegmentMaxDuration } It "Should have SegmentMaxSize as a parameter" { - $CommandUnderTest | Should -HaveParameter SegmentMaxSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter SegmentMaxSize } It "Should have Subdirectory as a parameter" { - $CommandUnderTest | Should -HaveParameter Subdirectory -Type System.String + $CommandUnderTest | Should -HaveParameter Subdirectory } It "Should have SubdirectoryFormat as a parameter" { - $CommandUnderTest | Should -HaveParameter SubdirectoryFormat -Type System.Int32 + $CommandUnderTest | Should -HaveParameter SubdirectoryFormat } It "Should have SubdirectoryFormatPattern as a parameter" { - $CommandUnderTest | Should -HaveParameter SubdirectoryFormatPattern -Type System.String + $CommandUnderTest | Should -HaveParameter SubdirectoryFormatPattern } It "Should have Task as a parameter" { - $CommandUnderTest | Should -HaveParameter Task -Type System.String + $CommandUnderTest | Should -HaveParameter Task } It "Should have TaskRunAsSelf as a switch parameter" { - $CommandUnderTest | Should -HaveParameter TaskRunAsSelf -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter TaskRunAsSelf } It "Should have TaskArguments as a parameter" { - $CommandUnderTest | Should -HaveParameter TaskArguments -Type System.String + $CommandUnderTest | Should -HaveParameter TaskArguments } It "Should have TaskUserTextArguments as a parameter" { - $CommandUnderTest | Should -HaveParameter TaskUserTextArguments -Type System.String + $CommandUnderTest | Should -HaveParameter TaskUserTextArguments } It "Should have StopOnCompletion as a switch parameter" { - $CommandUnderTest | Should -HaveParameter StopOnCompletion -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter StopOnCompletion } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String[] + $CommandUnderTest | Should -HaveParameter Path } It "Should have Template as a parameter" { - $CommandUnderTest | Should -HaveParameter Template -Type System.String[] + $CommandUnderTest | Should -HaveParameter Template } It "Should have Instance as a parameter" { - $CommandUnderTest | Should -HaveParameter Instance -Type System.String[] + $CommandUnderTest | Should -HaveParameter Instance } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Import-DbaRegServer.Tests.ps1 b/tests/Import-DbaRegServer.Tests.ps1 index df0b6bb0e5..d9d8c54482 100644 --- a/tests/Import-DbaRegServer.Tests.ps1 +++ b/tests/Import-DbaRegServer.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Import-DbaRegServer" { $CommandUnderTest = Get-Command Import-DbaRegServer } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Group parameter" { - $CommandUnderTest | Should -HaveParameter Group -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Group } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Import-DbaSpConfigure.Tests.ps1 b/tests/Import-DbaSpConfigure.Tests.ps1 index 6cbd836987..891fb53313 100644 --- a/tests/Import-DbaSpConfigure.Tests.ps1 +++ b/tests/Import-DbaSpConfigure.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Import-DbaSpConfigure" { $CommandUnderTest = Get-Command Import-DbaSpConfigure } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Destination } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Import-DbaXESessionTemplate.Tests.ps1 b/tests/Import-DbaXESessionTemplate.Tests.ps1 index b8b8dbb8fd..6eabccfc45 100644 --- a/tests/Import-DbaXESessionTemplate.Tests.ps1 +++ b/tests/Import-DbaXESessionTemplate.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Import-DbaXESessionTemplate" { $CommandUnderTest = Get-Command Import-DbaXESessionTemplate } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String + $CommandUnderTest | Should -HaveParameter Name } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String[] + $CommandUnderTest | Should -HaveParameter Path } It "Should have Template as a parameter" { - $CommandUnderTest | Should -HaveParameter Template -Type System.String[] + $CommandUnderTest | Should -HaveParameter Template } It "Should have TargetFilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter TargetFilePath -Type System.String + $CommandUnderTest | Should -HaveParameter TargetFilePath } It "Should have TargetFileMetadataPath as a parameter" { - $CommandUnderTest | Should -HaveParameter TargetFileMetadataPath -Type System.String + $CommandUnderTest | Should -HaveParameter TargetFileMetadataPath } It "Should have StartUpState as a parameter" { - $CommandUnderTest | Should -HaveParameter StartUpState -Type System.String + $CommandUnderTest | Should -HaveParameter StartUpState } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Import-DbatoolsConfig.Tests.ps1 b/tests/Import-DbatoolsConfig.Tests.ps1 index c8af7646f3..13287089f8 100644 --- a/tests/Import-DbatoolsConfig.Tests.ps1 +++ b/tests/Import-DbatoolsConfig.Tests.ps1 @@ -11,29 +11,29 @@ Describe "Import-DbatoolsConfig" { BeforeAll { $CommandUnderTest = Get-Command Import-DbatoolsConfig } - It "Should have Path as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String[] -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } - It "Should have ModuleName as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter ModuleName -Type System.String -Mandatory:$false + It "Should have ModuleName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ModuleName } - It "Should have ModuleVersion as a non-mandatory System.Int32 parameter" { - $CommandUnderTest | Should -HaveParameter ModuleVersion -Type System.Int32 -Mandatory:$false + It "Should have ModuleVersion as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ModuleVersion } - It "Should have Scope as a non-mandatory Dataplat.Dbatools.Configuration.ConfigScope parameter" { - $CommandUnderTest | Should -HaveParameter Scope -Type Dataplat.Dbatools.Configuration.ConfigScope -Mandatory:$false + It "Should have Scope as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Scope } - It "Should have IncludeFilter as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter IncludeFilter -Type System.String[] -Mandatory:$false + It "Should have IncludeFilter as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter IncludeFilter } - It "Should have ExcludeFilter as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeFilter -Type System.String[] -Mandatory:$false + It "Should have ExcludeFilter as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeFilter } - It "Should have Peek as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter Peek -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have Peek as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Peek } - It "Should have EnableException as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have EnableException as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/InModule.Commands.Tests.ps1 b/tests/InModule.Commands.Tests.ps1 index 69115cd8b7..379ffa3203 100644 --- a/tests/InModule.Commands.Tests.ps1 +++ b/tests/InModule.Commands.Tests.ps1 @@ -12,4 +12,4 @@ Describe "$commandname Integration Tests" -Tag "IntegrationTests" { $dupes.Name | Should -be $null } } -} \ No newline at end of file +} diff --git a/tests/InModule.Help.Tests.ps1 b/tests/InModule.Help.Tests.ps1 index d7ed83c3bc..e4a1935d47 100644 --- a/tests/InModule.Help.Tests.ps1 +++ b/tests/InModule.Help.Tests.ps1 @@ -136,16 +136,6 @@ foreach ($command in $commands) { $testparamserrors += 1 } - $testparamsall += 1 - $codeMandatory = $parameter.IsMandatory.toString() - if ($parameterHelp.Required -ne $codeMandatory) { - # Required value in Help should match IsMandatory property of parameter - It "help for $parameterName parameter in $commandName has correct Mandatory value" { - $parameterHelp.Required | Should Be $codeMandatory - } - $testparamserrors += 1 - } - if ($HelpTestSkipParameterType[$commandName] -contains $parameterName) { continue } $codeType = $parameter.ParameterType.Name diff --git a/tests/Install-DbaAgentAdminAlert.Tests.ps1 b/tests/Install-DbaAgentAdminAlert.Tests.ps1 index 8afa9857b1..ebdb37404f 100644 --- a/tests/Install-DbaAgentAdminAlert.Tests.ps1 +++ b/tests/Install-DbaAgentAdminAlert.Tests.ps1 @@ -11,52 +11,52 @@ Describe "Install-DbaAgentAdminAlert" { $CommandUnderTest = Get-Command Install-DbaAgentAdminAlert } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Microsoft.SqlServer.Management.Smo.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Category as a parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type System.String + $CommandUnderTest | Should -HaveParameter Category } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have Operator as a parameter" { - $CommandUnderTest | Should -HaveParameter Operator -Type System.String + $CommandUnderTest | Should -HaveParameter Operator } It "Should have OperatorEmail as a parameter" { - $CommandUnderTest | Should -HaveParameter OperatorEmail -Type System.String + $CommandUnderTest | Should -HaveParameter OperatorEmail } It "Should have DelayBetweenResponses as a parameter" { - $CommandUnderTest | Should -HaveParameter DelayBetweenResponses -Type System.Int32 + $CommandUnderTest | Should -HaveParameter DelayBetweenResponses } It "Should have Disabled as a parameter" { - $CommandUnderTest | Should -HaveParameter Disabled -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Disabled } It "Should have EventDescriptionKeyword as a parameter" { - $CommandUnderTest | Should -HaveParameter EventDescriptionKeyword -Type System.String + $CommandUnderTest | Should -HaveParameter EventDescriptionKeyword } It "Should have EventSource as a parameter" { - $CommandUnderTest | Should -HaveParameter EventSource -Type System.String + $CommandUnderTest | Should -HaveParameter EventSource } It "Should have JobId as a parameter" { - $CommandUnderTest | Should -HaveParameter JobId -Type System.String + $CommandUnderTest | Should -HaveParameter JobId } It "Should have ExcludeSeverity as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSeverity -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter ExcludeSeverity } It "Should have ExcludeMessageId as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeMessageId -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter ExcludeMessageId } It "Should have NotificationMessage as a parameter" { - $CommandUnderTest | Should -HaveParameter NotificationMessage -Type System.String + $CommandUnderTest | Should -HaveParameter NotificationMessage } It "Should have NotifyMethod as a parameter" { - $CommandUnderTest | Should -HaveParameter NotifyMethod -Type System.String + $CommandUnderTest | Should -HaveParameter NotifyMethod } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Install-DbaDarlingData.Tests.ps1 b/tests/Install-DbaDarlingData.Tests.ps1 index f72c355be4..c2f569e42d 100644 --- a/tests/Install-DbaDarlingData.Tests.ps1 +++ b/tests/Install-DbaDarlingData.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Install-DbaDarlingData" { $CommandUnderTest = Get-Command Install-DbaDarlingData } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Microsoft.SqlServer.Management.Smo.Database + $CommandUnderTest | Should -HaveParameter Database } It "Should have Branch as a parameter" { - $CommandUnderTest | Should -HaveParameter Branch -Type System.String + $CommandUnderTest | Should -HaveParameter Branch } It "Should have Procedure as a parameter" { - $CommandUnderTest | Should -HaveParameter Procedure -Type System.String[] + $CommandUnderTest | Should -HaveParameter Procedure } It "Should have LocalFile as a parameter" { - $CommandUnderTest | Should -HaveParameter LocalFile -Type System.String + $CommandUnderTest | Should -HaveParameter LocalFile } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Install-DbaFirstResponderKit.Tests.ps1 b/tests/Install-DbaFirstResponderKit.Tests.ps1 index cceeeb4f29..8ff08eaaec 100644 --- a/tests/Install-DbaFirstResponderKit.Tests.ps1 +++ b/tests/Install-DbaFirstResponderKit.Tests.ps1 @@ -10,28 +10,28 @@ Describe "Install-DbaFirstResponderKit" { $CommandUnderTest = Get-Command Install-DbaFirstResponderKit } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Branch parameter" { - $CommandUnderTest | Should -HaveParameter Branch -Type System.String + $CommandUnderTest | Should -HaveParameter Branch } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object + $CommandUnderTest | Should -HaveParameter Database } It "Should have LocalFile parameter" { - $CommandUnderTest | Should -HaveParameter LocalFile -Type System.String + $CommandUnderTest | Should -HaveParameter LocalFile } It "Should have OnlyScript parameter" { - $CommandUnderTest | Should -HaveParameter OnlyScript -Type System.String[] + $CommandUnderTest | Should -HaveParameter OnlyScript } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Install-DbaInstance.Tests.ps1 b/tests/Install-DbaInstance.Tests.ps1 index 1bf2ce5139..ba611f4c78 100644 --- a/tests/Install-DbaInstance.Tests.ps1 +++ b/tests/Install-DbaInstance.Tests.ps1 @@ -29,109 +29,109 @@ Describe "Install-DbaInstance" { $command = Get-Command -Name Install-DbaInstance } It "Should have SqlInstance parameter" { - $command | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $command | Should -HaveParameter SqlInstance } It "Should have Version parameter" { - $command | Should -HaveParameter Version -Type System.String -Mandatory:$false + $command | Should -HaveParameter Version } It "Should have InstanceName parameter" { - $command | Should -HaveParameter InstanceName -Type System.String -Mandatory:$false + $command | Should -HaveParameter InstanceName } It "Should have SaCredential parameter" { - $command | Should -HaveParameter SaCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $command | Should -HaveParameter SaCredential } It "Should have Credential parameter" { - $command | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $command | Should -HaveParameter Credential } It "Should have Authentication parameter" { - $command | Should -HaveParameter Authentication -Type System.String -Mandatory:$false + $command | Should -HaveParameter Authentication } It "Should have ConfigurationFile parameter" { - $command | Should -HaveParameter ConfigurationFile -Type System.Object -Mandatory:$false + $command | Should -HaveParameter ConfigurationFile } It "Should have Configuration parameter" { - $command | Should -HaveParameter Configuration -Type System.Collections.Hashtable -Mandatory:$false + $command | Should -HaveParameter Configuration } It "Should have Path parameter" { - $command | Should -HaveParameter Path -Type System.String[] -Mandatory:$false + $command | Should -HaveParameter Path } It "Should have Feature parameter" { - $command | Should -HaveParameter Feature -Type System.String[] -Mandatory:$false + $command | Should -HaveParameter Feature } It "Should have AuthenticationMode parameter" { - $command | Should -HaveParameter AuthenticationMode -Type System.String -Mandatory:$false + $command | Should -HaveParameter AuthenticationMode } It "Should have InstancePath parameter" { - $command | Should -HaveParameter InstancePath -Type System.String -Mandatory:$false + $command | Should -HaveParameter InstancePath } It "Should have DataPath parameter" { - $command | Should -HaveParameter DataPath -Type System.String -Mandatory:$false + $command | Should -HaveParameter DataPath } It "Should have LogPath parameter" { - $command | Should -HaveParameter LogPath -Type System.String -Mandatory:$false + $command | Should -HaveParameter LogPath } It "Should have TempPath parameter" { - $command | Should -HaveParameter TempPath -Type System.String -Mandatory:$false + $command | Should -HaveParameter TempPath } It "Should have BackupPath parameter" { - $command | Should -HaveParameter BackupPath -Type System.String -Mandatory:$false + $command | Should -HaveParameter BackupPath } It "Should have UpdateSourcePath parameter" { - $command | Should -HaveParameter UpdateSourcePath -Type System.String -Mandatory:$false + $command | Should -HaveParameter UpdateSourcePath } It "Should have AdminAccount parameter" { - $command | Should -HaveParameter AdminAccount -Type System.String[] -Mandatory:$false + $command | Should -HaveParameter AdminAccount } It "Should have Port parameter" { - $command | Should -HaveParameter Port -Type System.Int32 -Mandatory:$false + $command | Should -HaveParameter Port } It "Should have Throttle parameter" { - $command | Should -HaveParameter Throttle -Type System.Int32 -Mandatory:$false + $command | Should -HaveParameter Throttle } It "Should have ProductID parameter" { - $command | Should -HaveParameter ProductID -Type System.String -Mandatory:$false + $command | Should -HaveParameter ProductID } It "Should have AsCollation parameter" { - $command | Should -HaveParameter AsCollation -Type System.String -Mandatory:$false + $command | Should -HaveParameter AsCollation } It "Should have SqlCollation parameter" { - $command | Should -HaveParameter SqlCollation -Type System.String -Mandatory:$false + $command | Should -HaveParameter SqlCollation } It "Should have EngineCredential parameter" { - $command | Should -HaveParameter EngineCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $command | Should -HaveParameter EngineCredential } It "Should have AgentCredential parameter" { - $command | Should -HaveParameter AgentCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $command | Should -HaveParameter AgentCredential } It "Should have ASCredential parameter" { - $command | Should -HaveParameter ASCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $command | Should -HaveParameter ASCredential } It "Should have ISCredential parameter" { - $command | Should -HaveParameter ISCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $command | Should -HaveParameter ISCredential } It "Should have RSCredential parameter" { - $command | Should -HaveParameter RSCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $command | Should -HaveParameter RSCredential } It "Should have FTCredential parameter" { - $command | Should -HaveParameter FTCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $command | Should -HaveParameter FTCredential } It "Should have PBEngineCredential parameter" { - $command | Should -HaveParameter PBEngineCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $command | Should -HaveParameter PBEngineCredential } It "Should have SaveConfiguration parameter" { - $command | Should -HaveParameter SaveConfiguration -Type System.String -Mandatory:$false + $command | Should -HaveParameter SaveConfiguration } It "Should have PerformVolumeMaintenanceTasks parameter" { - $command | Should -HaveParameter PerformVolumeMaintenanceTasks -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $command | Should -HaveParameter PerformVolumeMaintenanceTasks } It "Should have Restart parameter" { - $command | Should -HaveParameter Restart -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $command | Should -HaveParameter Restart } It "Should have NoPendingRenameCheck parameter" { - $command | Should -HaveParameter NoPendingRenameCheck -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $command | Should -HaveParameter NoPendingRenameCheck } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $command | Should -HaveParameter EnableException } } diff --git a/tests/Install-DbaMaintenanceSolution.Tests.ps1 b/tests/Install-DbaMaintenanceSolution.Tests.ps1 index a73e24202d..ecff1f931e 100644 --- a/tests/Install-DbaMaintenanceSolution.Tests.ps1 +++ b/tests/Install-DbaMaintenanceSolution.Tests.ps1 @@ -10,52 +10,52 @@ Describe "Install-DbaMaintenanceSolution" { $CommandUnderTest = Get-Command Install-DbaMaintenanceSolution } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have BackupLocation parameter" { - $CommandUnderTest | Should -HaveParameter BackupLocation -Type System.String + $CommandUnderTest | Should -HaveParameter BackupLocation } It "Should have CleanupTime parameter" { - $CommandUnderTest | Should -HaveParameter CleanupTime -Type System.Int32 + $CommandUnderTest | Should -HaveParameter CleanupTime } It "Should have OutputFileDirectory parameter" { - $CommandUnderTest | Should -HaveParameter OutputFileDirectory -Type System.String + $CommandUnderTest | Should -HaveParameter OutputFileDirectory } It "Should have ReplaceExisting parameter" { - $CommandUnderTest | Should -HaveParameter ReplaceExisting -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ReplaceExisting } It "Should have LogToTable parameter" { - $CommandUnderTest | Should -HaveParameter LogToTable -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter LogToTable } It "Should have Solution parameter" { - $CommandUnderTest | Should -HaveParameter Solution -Type System.String[] + $CommandUnderTest | Should -HaveParameter Solution } It "Should have InstallJobs parameter" { - $CommandUnderTest | Should -HaveParameter InstallJobs -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter InstallJobs } It "Should have AutoScheduleJobs parameter" { - $CommandUnderTest | Should -HaveParameter AutoScheduleJobs -Type System.String[] + $CommandUnderTest | Should -HaveParameter AutoScheduleJobs } It "Should have StartTime parameter" { - $CommandUnderTest | Should -HaveParameter StartTime -Type System.String + $CommandUnderTest | Should -HaveParameter StartTime } It "Should have LocalFile parameter" { - $CommandUnderTest | Should -HaveParameter LocalFile -Type System.String + $CommandUnderTest | Should -HaveParameter LocalFile } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have InstallParallel parameter" { - $CommandUnderTest | Should -HaveParameter InstallParallel -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter InstallParallel } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Install-DbaMultiTool.Tests.ps1 b/tests/Install-DbaMultiTool.Tests.ps1 index 8c0321c2a6..30d0099032 100644 --- a/tests/Install-DbaMultiTool.Tests.ps1 +++ b/tests/Install-DbaMultiTool.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Install-DbaMultiTool" { $CommandUnderTest = Get-Command Install-DbaMultiTool } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Branch parameter" { - $CommandUnderTest | Should -HaveParameter Branch -Type System.String + $CommandUnderTest | Should -HaveParameter Branch } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object + $CommandUnderTest | Should -HaveParameter Database } It "Should have LocalFile parameter" { - $CommandUnderTest | Should -HaveParameter LocalFile -Type System.String + $CommandUnderTest | Should -HaveParameter LocalFile } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Install-DbaSqlWatch.Tests.ps1 b/tests/Install-DbaSqlWatch.Tests.ps1 index 5538dac6cf..897f6439f5 100644 --- a/tests/Install-DbaSqlWatch.Tests.ps1 +++ b/tests/Install-DbaSqlWatch.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Install-DbaSqlWatch" { $CommandUnderTest = Get-Command Install-DbaSqlWatch } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have LocalFile as a parameter" { - $CommandUnderTest | Should -HaveParameter LocalFile -Type System.String + $CommandUnderTest | Should -HaveParameter LocalFile } It "Should have PreRelease as a switch parameter" { - $CommandUnderTest | Should -HaveParameter PreRelease -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter PreRelease } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Install-DbaWhoIsActive.Tests.ps1 b/tests/Install-DbaWhoIsActive.Tests.ps1 index f0310d59ba..9b81f0740f 100644 --- a/tests/Install-DbaWhoIsActive.Tests.ps1 +++ b/tests/Install-DbaWhoIsActive.Tests.ps1 @@ -185,32 +185,26 @@ ALTER PROC dbo.sp_WhoIsActive It "Should have SqlInstance parameter" { $ParameterList['SqlInstance'] | Should -Not -BeNullOrEmpty $ParameterList['SqlInstance'].ParameterType.FullName | Should -Be 'Dataplat.Dbatools.Parameter.DbaInstanceParameter[]' - $ParameterList['SqlInstance'].IsMandatory | Should -Be $false } It "Should have SqlCredential parameter" { $ParameterList['SqlCredential'] | Should -Not -BeNullOrEmpty $ParameterList['SqlCredential'].ParameterType.FullName | Should -Be 'System.Management.Automation.PSCredential' - $ParameterList['SqlCredential'].IsMandatory | Should -Be $false } It "Should have LocalFile parameter" { $ParameterList['LocalFile'] | Should -Not -BeNullOrEmpty $ParameterList['LocalFile'].ParameterType.FullName | Should -Be 'System.String' - $ParameterList['LocalFile'].IsMandatory | Should -Be $false } It "Should have Database parameter" { $ParameterList['Database'] | Should -Not -BeNullOrEmpty $ParameterList['Database'].ParameterType.FullName | Should -Be 'System.Object' - $ParameterList['Database'].IsMandatory | Should -Be $false } It "Should have EnableException parameter" { $ParameterList['EnableException'] | Should -Not -BeNullOrEmpty $ParameterList['EnableException'].ParameterType.FullName | Should -Be 'System.Management.Automation.SwitchParameter' - $ParameterList['EnableException'].IsMandatory | Should -Be $false } It "Should have Force parameter" { $ParameterList['Force'] | Should -Not -BeNullOrEmpty $ParameterList['Force'].ParameterType.FullName | Should -Be 'System.Management.Automation.SwitchParameter' - $ParameterList['Force'].IsMandatory | Should -Be $false } } diff --git a/tests/Invoke-DbaAdvancedInstall.Tests.ps1 b/tests/Invoke-DbaAdvancedInstall.Tests.ps1 index 1760a1e339..1a19d17566 100644 --- a/tests/Invoke-DbaAdvancedInstall.Tests.ps1 +++ b/tests/Invoke-DbaAdvancedInstall.Tests.ps1 @@ -33,52 +33,52 @@ Describe "Invoke-DbaAdvancedInstall" { $CommandUnderTest = Get-Command Invoke-DbaAdvancedInstall } It "Should have ComputerName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName -Type System.String } It "Should have InstanceName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter InstanceName -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InstanceName -Type System.String } It "Should have Port as a non-mandatory Nullable`1 parameter" { - $CommandUnderTest | Should -HaveParameter Port -Type ([System.Nullable`1]) -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Port -Type ([System.Nullable`1]) } It "Should have InstallationPath as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter InstallationPath -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InstallationPath -Type System.String } It "Should have ConfigurationPath as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ConfigurationPath -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ConfigurationPath -Type System.String } It "Should have ArgumentList as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter ArgumentList -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ArgumentList -Type System.String[] } It "Should have Version as a non-mandatory Version parameter" { - $CommandUnderTest | Should -HaveParameter Version -Type System.Version -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Version -Type System.Version } It "Should have Configuration as a non-mandatory Hashtable parameter" { - $CommandUnderTest | Should -HaveParameter Configuration -Type System.Collections.Hashtable -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Configuration -Type System.Collections.Hashtable } It "Should have Restart as a non-mandatory Boolean parameter" { - $CommandUnderTest | Should -HaveParameter Restart -Type System.Boolean -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Restart -Type System.Boolean } It "Should have PerformVolumeMaintenanceTasks as a non-mandatory Boolean parameter" { - $CommandUnderTest | Should -HaveParameter PerformVolumeMaintenanceTasks -Type System.Boolean -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PerformVolumeMaintenanceTasks -Type System.Boolean } It "Should have SaveConfiguration as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter SaveConfiguration -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SaveConfiguration -Type System.String } It "Should have Authentication as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Authentication -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Authentication -Type System.String } It "Should have Credential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential } It "Should have SaCredential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter SaCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SaCredential -Type System.Management.Automation.PSCredential } It "Should have NoPendingRenameCheck as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter NoPendingRenameCheck -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoPendingRenameCheck -Type System.Management.Automation.SwitchParameter } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter } } diff --git a/tests/Invoke-DbaAdvancedRestore.Tests.ps1 b/tests/Invoke-DbaAdvancedRestore.Tests.ps1 index 5f309f284e..457384de63 100644 --- a/tests/Invoke-DbaAdvancedRestore.Tests.ps1 +++ b/tests/Invoke-DbaAdvancedRestore.Tests.ps1 @@ -12,70 +12,70 @@ Describe "Invoke-DbaAdvancedRestore" { $CommandUnderTest = Get-Command Invoke-DbaAdvancedRestore } It "Should have BackupHistory parameter" { - $CommandUnderTest | Should -HaveParameter BackupHistory -Type System.Object[] + $CommandUnderTest | Should -HaveParameter BackupHistory } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have OutputScriptOnly parameter" { - $CommandUnderTest | Should -HaveParameter OutputScriptOnly -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter OutputScriptOnly } It "Should have VerifyOnly parameter" { - $CommandUnderTest | Should -HaveParameter VerifyOnly -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter VerifyOnly } It "Should have RestoreTime parameter" { - $CommandUnderTest | Should -HaveParameter RestoreTime -Type System.DateTime + $CommandUnderTest | Should -HaveParameter RestoreTime } It "Should have StandbyDirectory parameter" { - $CommandUnderTest | Should -HaveParameter StandbyDirectory -Type System.String + $CommandUnderTest | Should -HaveParameter StandbyDirectory } It "Should have NoRecovery parameter" { - $CommandUnderTest | Should -HaveParameter NoRecovery -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoRecovery } It "Should have MaxTransferSize parameter" { - $CommandUnderTest | Should -HaveParameter MaxTransferSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter MaxTransferSize } It "Should have BlockSize parameter" { - $CommandUnderTest | Should -HaveParameter BlockSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BlockSize } It "Should have BufferCount parameter" { - $CommandUnderTest | Should -HaveParameter BufferCount -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BufferCount } It "Should have Continue parameter" { - $CommandUnderTest | Should -HaveParameter Continue -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Continue } It "Should have AzureCredential parameter" { - $CommandUnderTest | Should -HaveParameter AzureCredential -Type System.String + $CommandUnderTest | Should -HaveParameter AzureCredential } It "Should have WithReplace parameter" { - $CommandUnderTest | Should -HaveParameter WithReplace -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter WithReplace } It "Should have KeepReplication parameter" { - $CommandUnderTest | Should -HaveParameter KeepReplication -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter KeepReplication } It "Should have KeepCDC parameter" { - $CommandUnderTest | Should -HaveParameter KeepCDC -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter KeepCDC } It "Should have PageRestore parameter" { - $CommandUnderTest | Should -HaveParameter PageRestore -Type System.Object[] + $CommandUnderTest | Should -HaveParameter PageRestore } It "Should have ExecuteAs parameter" { - $CommandUnderTest | Should -HaveParameter ExecuteAs -Type System.String + $CommandUnderTest | Should -HaveParameter ExecuteAs } It "Should have StopBefore parameter" { - $CommandUnderTest | Should -HaveParameter StopBefore -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter StopBefore } It "Should have StopMark parameter" { - $CommandUnderTest | Should -HaveParameter StopMark -Type System.String + $CommandUnderTest | Should -HaveParameter StopMark } It "Should have StopAfterDate parameter" { - $CommandUnderTest | Should -HaveParameter StopAfterDate -Type System.DateTime + $CommandUnderTest | Should -HaveParameter StopAfterDate } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Invoke-DbaAdvancedUpdate.Tests.ps1 b/tests/Invoke-DbaAdvancedUpdate.Tests.ps1 index 33e1457ffd..2fadeaa4fb 100644 --- a/tests/Invoke-DbaAdvancedUpdate.Tests.ps1 +++ b/tests/Invoke-DbaAdvancedUpdate.Tests.ps1 @@ -26,32 +26,32 @@ Describe "Invoke-DbaAdvancedUpdate" { BeforeAll { $CommandUnderTest = Get-Command Invoke-DbaAdvancedUpdate } - It "Should have ComputerName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type System.String -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Action as a non-mandatory Object[] parameter" { - $CommandUnderTest | Should -HaveParameter Action -Type System.Object[] -Mandatory:$false + It "Should have Action as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Action } - It "Should have Restart as a non-mandatory Boolean parameter" { - $CommandUnderTest | Should -HaveParameter Restart -Type System.Boolean -Mandatory:$false + It "Should have Restart as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Restart } - It "Should have Authentication as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Authentication -Type System.String -Mandatory:$false + It "Should have Authentication as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Authentication } - It "Should have Credential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } - It "Should have ExtractPath as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ExtractPath -Type System.String -Mandatory:$false + It "Should have ExtractPath as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExtractPath } - It "Should have ArgumentList as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter ArgumentList -Type System.String[] -Mandatory:$false + It "Should have ArgumentList as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ArgumentList } It "Should have NoPendingRenameCheck as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter NoPendingRenameCheck -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoPendingRenameCheck } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbaAgFailover.Tests.ps1 b/tests/Invoke-DbaAgFailover.Tests.ps1 index 6e7b8c97e8..9e7ab39747 100644 --- a/tests/Invoke-DbaAgFailover.Tests.ps1 +++ b/tests/Invoke-DbaAgFailover.Tests.ps1 @@ -10,22 +10,22 @@ Describe "Invoke-DbaAgFailover" { $CommandUnderTest = Get-Command Invoke-DbaAgFailover } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have AvailabilityGroup parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityGroup[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbaAzSqlDbTip.Tests.ps1 b/tests/Invoke-DbaAzSqlDbTip.Tests.ps1 index d6b34ff5b6..b451211695 100644 --- a/tests/Invoke-DbaAzSqlDbTip.Tests.ps1 +++ b/tests/Invoke-DbaAzSqlDbTip.Tests.ps1 @@ -12,43 +12,43 @@ Describe "Invoke-DbaAzSqlDbTip" { $CommandUnderTest = Get-Command Invoke-DbaAzSqlDbTip } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have AzureDomain as a parameter" { - $CommandUnderTest | Should -HaveParameter AzureDomain -Type System.String + $CommandUnderTest | Should -HaveParameter AzureDomain } It "Should have Tenant as a parameter" { - $CommandUnderTest | Should -HaveParameter Tenant -Type System.String + $CommandUnderTest | Should -HaveParameter Tenant } It "Should have LocalFile as a parameter" { - $CommandUnderTest | Should -HaveParameter LocalFile -Type System.String + $CommandUnderTest | Should -HaveParameter LocalFile } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have AllUserDatabases as a switch parameter" { - $CommandUnderTest | Should -HaveParameter AllUserDatabases -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AllUserDatabases } It "Should have ReturnAllTips as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ReturnAllTips -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ReturnAllTips } It "Should have Compat100 as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Compat100 -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Compat100 } It "Should have StatementTimeout as a parameter" { - $CommandUnderTest | Should -HaveParameter StatementTimeout -Type System.Int32 + $CommandUnderTest | Should -HaveParameter StatementTimeout } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } } diff --git a/tests/Invoke-DbaBalanceDataFiles.Tests.ps1 b/tests/Invoke-DbaBalanceDataFiles.Tests.ps1 index c17ff7cc36..cc92413ebf 100644 --- a/tests/Invoke-DbaBalanceDataFiles.Tests.ps1 +++ b/tests/Invoke-DbaBalanceDataFiles.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Invoke-DbaBalanceDataFiles" { $CommandUnderTest = Get-Command Invoke-DbaBalanceDataFiles } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Table parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Table } It "Should have RebuildOffline parameter" { - $CommandUnderTest | Should -HaveParameter RebuildOffline -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter RebuildOffline } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } } } diff --git a/tests/Invoke-DbaCycleErrorLog.Tests.ps1 b/tests/Invoke-DbaCycleErrorLog.Tests.ps1 index 9dfb22b93f..27abff6112 100644 --- a/tests/Invoke-DbaCycleErrorLog.Tests.ps1 +++ b/tests/Invoke-DbaCycleErrorLog.Tests.ps1 @@ -13,19 +13,19 @@ Describe "Invoke-DbaCycleErrorLog Unit Tests" -Tag "UnitTests" { } It "Should have SqlInstance parameter" { - $command | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $command | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] } It "Should have SqlCredential parameter" { - $command | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $command | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential } It "Should have Type parameter" { - $command | Should -HaveParameter Type -Type System.String -Mandatory:$false + $command | Should -HaveParameter Type } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $command | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter } } } diff --git a/tests/Invoke-DbaDbClone.Tests.ps1 b/tests/Invoke-DbaDbClone.Tests.ps1 index 797b9b554a..f1748ae8bb 100644 --- a/tests/Invoke-DbaDbClone.Tests.ps1 +++ b/tests/Invoke-DbaDbClone.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Invoke-DbaDbClone" { $CommandUnderTest = Get-Command Invoke-DbaDbClone } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have CloneDatabase parameter" { - $CommandUnderTest | Should -HaveParameter CloneDatabase -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CloneDatabase } It "Should have ExcludeStatistics parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeStatistics -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeStatistics } It "Should have ExcludeQueryStore parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeQueryStore -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeQueryStore } It "Should have UpdateStatistics parameter" { - $CommandUnderTest | Should -HaveParameter UpdateStatistics -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter UpdateStatistics } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbaDbCorruption.Tests.ps1 b/tests/Invoke-DbaDbCorruption.Tests.ps1 index 770bb0bd2b..e326655ccd 100644 --- a/tests/Invoke-DbaDbCorruption.Tests.ps1 +++ b/tests/Invoke-DbaDbCorruption.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Invoke-DbaDbCorruption" { $CommandUnderTest = Get-Command Invoke-DbaDbCorruption } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have Table parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String + $CommandUnderTest | Should -HaveParameter Table } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbaDbDataGenerator.Tests.ps1 b/tests/Invoke-DbaDbDataGenerator.Tests.ps1 index 295f320daf..ad712c4042 100644 --- a/tests/Invoke-DbaDbDataGenerator.Tests.ps1 +++ b/tests/Invoke-DbaDbDataGenerator.Tests.ps1 @@ -12,46 +12,46 @@ Describe "Invoke-DbaDbDataGenerator" { $CommandUnderTest = Get-Command Invoke-DbaDbDataGenerator } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have FilePath parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have Locale parameter" { - $CommandUnderTest | Should -HaveParameter Locale -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Locale } It "Should have CharacterString parameter" { - $CommandUnderTest | Should -HaveParameter CharacterString -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CharacterString } It "Should have Table parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Table } It "Should have Column parameter" { - $CommandUnderTest | Should -HaveParameter Column -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Column } It "Should have ExcludeTable parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeTable -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeTable } It "Should have ExcludeColumn parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeColumn -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeColumn } It "Should have MaxValue parameter" { - $CommandUnderTest | Should -HaveParameter MaxValue -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaxValue } It "Should have ExactLength parameter" { - $CommandUnderTest | Should -HaveParameter ExactLength -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExactLength } It "Should have ModulusFactor parameter" { - $CommandUnderTest | Should -HaveParameter ModulusFactor -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ModulusFactor } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbaDbDataMasking.Tests.ps1 b/tests/Invoke-DbaDbDataMasking.Tests.ps1 index 69e9af86bb..feabc428c0 100644 --- a/tests/Invoke-DbaDbDataMasking.Tests.ps1 +++ b/tests/Invoke-DbaDbDataMasking.Tests.ps1 @@ -38,61 +38,61 @@ Describe "Invoke-DbaDbDataMasking" { $CommandUnderTest = Get-Command Invoke-DbaDbDataMasking } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have FilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.Object + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have Locale as a parameter" { - $CommandUnderTest | Should -HaveParameter Locale -Type System.String + $CommandUnderTest | Should -HaveParameter Locale } It "Should have CharacterString as a parameter" { - $CommandUnderTest | Should -HaveParameter CharacterString -Type System.String + $CommandUnderTest | Should -HaveParameter CharacterString } It "Should have Table as a parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] + $CommandUnderTest | Should -HaveParameter Table } It "Should have Column as a parameter" { - $CommandUnderTest | Should -HaveParameter Column -Type System.String[] + $CommandUnderTest | Should -HaveParameter Column } It "Should have ExcludeTable as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeTable -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeTable } It "Should have ExcludeColumn as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeColumn -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeColumn } It "Should have MaxValue as a parameter" { - $CommandUnderTest | Should -HaveParameter MaxValue -Type System.Int32 + $CommandUnderTest | Should -HaveParameter MaxValue } It "Should have ModulusFactor as a parameter" { - $CommandUnderTest | Should -HaveParameter ModulusFactor -Type System.Int32 + $CommandUnderTest | Should -HaveParameter ModulusFactor } It "Should have ExactLength as a parameter" { - $CommandUnderTest | Should -HaveParameter ExactLength -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter ExactLength } It "Should have CommandTimeout as a parameter" { - $CommandUnderTest | Should -HaveParameter CommandTimeout -Type System.Int32 + $CommandUnderTest | Should -HaveParameter CommandTimeout } It "Should have BatchSize as a parameter" { - $CommandUnderTest | Should -HaveParameter BatchSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BatchSize } It "Should have Retry as a parameter" { - $CommandUnderTest | Should -HaveParameter Retry -Type System.Int32 + $CommandUnderTest | Should -HaveParameter Retry } It "Should have DictionaryFilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter DictionaryFilePath -Type System.String[] + $CommandUnderTest | Should -HaveParameter DictionaryFilePath } It "Should have DictionaryExportPath as a parameter" { - $CommandUnderTest | Should -HaveParameter DictionaryExportPath -Type System.String + $CommandUnderTest | Should -HaveParameter DictionaryExportPath } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbaDbDbccCheckConstraint.Tests.ps1 b/tests/Invoke-DbaDbDbccCheckConstraint.Tests.ps1 index 93a49d7408..5a2b05c2d4 100644 --- a/tests/Invoke-DbaDbDbccCheckConstraint.Tests.ps1 +++ b/tests/Invoke-DbaDbDbccCheckConstraint.Tests.ps1 @@ -12,28 +12,28 @@ Describe "Invoke-DbaDbDbccCheckConstraint Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Invoke-DbaDbDbccCheckConstraint } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Microsoft.SqlServer.Management.Smo.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Object parameter" { - $CommandUnderTest | Should -HaveParameter Object -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Object } It "Should have AllConstraints parameter" { - $CommandUnderTest | Should -HaveParameter AllConstraints -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AllConstraints } It "Should have AllErrorMessages parameter" { - $CommandUnderTest | Should -HaveParameter AllErrorMessages -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AllErrorMessages } It "Should have NoInformationalMessages parameter" { - $CommandUnderTest | Should -HaveParameter NoInformationalMessages -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoInformationalMessages } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Invoke-DbaDbDbccCleanTable.Tests.ps1 b/tests/Invoke-DbaDbDbccCleanTable.Tests.ps1 index e010ed4149..322fc33c73 100644 --- a/tests/Invoke-DbaDbDbccCleanTable.Tests.ps1 +++ b/tests/Invoke-DbaDbDbccCleanTable.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Invoke-DbaDbDbccCleanTable" { $CommandUnderTest = Get-Command Invoke-DbaDbDbccCleanTable } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Microsoft.SqlServer.Management.Smo.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Object parameter" { - $CommandUnderTest | Should -HaveParameter Object -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Object } It "Should have BatchSize parameter" { - $CommandUnderTest | Should -HaveParameter BatchSize -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter BatchSize } It "Should have NoInformationalMessages parameter" { - $CommandUnderTest | Should -HaveParameter NoInformationalMessages -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoInformationalMessages } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbaDbDbccUpdateUsage.Tests.ps1 b/tests/Invoke-DbaDbDbccUpdateUsage.Tests.ps1 index 171e3e1ccc..2854a3c54e 100644 --- a/tests/Invoke-DbaDbDbccUpdateUsage.Tests.ps1 +++ b/tests/Invoke-DbaDbDbccUpdateUsage.Tests.ps1 @@ -26,28 +26,28 @@ Describe "Invoke-DbaDbDbccUpdateUsage" { $CommandUnderTest = Get-Command Invoke-DbaDbDbccUpdateUsage } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Table parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String + $CommandUnderTest | Should -HaveParameter Table } It "Should have Index parameter" { - $CommandUnderTest | Should -HaveParameter Index -Type System.String + $CommandUnderTest | Should -HaveParameter Index } It "Should have NoInformationalMessages parameter" { - $CommandUnderTest | Should -HaveParameter NoInformationalMessages -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoInformationalMessages } It "Should have CountRows parameter" { - $CommandUnderTest | Should -HaveParameter CountRows -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter CountRows } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbaDbDecryptObject.Tests.ps1 b/tests/Invoke-DbaDbDecryptObject.Tests.ps1 index 1c215e336e..f119bd2225 100644 --- a/tests/Invoke-DbaDbDecryptObject.Tests.ps1 +++ b/tests/Invoke-DbaDbDecryptObject.Tests.ps1 @@ -12,25 +12,25 @@ Describe "Invoke-DbaDbDecryptObject Unit Tests" -Tag 'UnitTests' { $command = Get-Command -Name $CommandName } It "Should have SqlInstance parameter" { - $command | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter -Mandatory:$false + $command | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $command | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $command | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $command | Should -HaveParameter Database -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $command | Should -HaveParameter Database } It "Should have ObjectName parameter" { - $command | Should -HaveParameter ObjectName -Type System.String[] -Mandatory:$false + $command | Should -HaveParameter ObjectName } It "Should have EncodingType parameter" { - $command | Should -HaveParameter EncodingType -Type System.String -Mandatory:$false + $command | Should -HaveParameter EncodingType } It "Should have ExportDestination parameter" { - $command | Should -HaveParameter ExportDestination -Type System.String -Mandatory:$false + $command | Should -HaveParameter ExportDestination } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $command | Should -HaveParameter EnableException } } } diff --git a/tests/Invoke-DbaDbLogShipRecovery.Tests.ps1 b/tests/Invoke-DbaDbLogShipRecovery.Tests.ps1 index 3326dd6ed8..6640f6ba13 100644 --- a/tests/Invoke-DbaDbLogShipRecovery.Tests.ps1 +++ b/tests/Invoke-DbaDbLogShipRecovery.Tests.ps1 @@ -12,28 +12,28 @@ Describe "Invoke-DbaDbLogShipRecovery" { $CommandUnderTest = Get-Command Invoke-DbaDbLogShipRecovery } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have NoRecovery as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoRecovery -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoRecovery } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Delay as a parameter" { - $CommandUnderTest | Should -HaveParameter Delay -Type System.Int32 + $CommandUnderTest | Should -HaveParameter Delay } } } diff --git a/tests/Invoke-DbaDbLogShipping.Tests.ps1 b/tests/Invoke-DbaDbLogShipping.Tests.ps1 index d391bbad05..fb2b10dc42 100644 --- a/tests/Invoke-DbaDbLogShipping.Tests.ps1 +++ b/tests/Invoke-DbaDbLogShipping.Tests.ps1 @@ -13,247 +13,247 @@ Describe "Invoke-DbaDbLogShipping" { $CommandUnderTest = Get-Command Invoke-DbaDbLogShipping } It "Should have SourceSqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SourceSqlInstance } It "Should have DestinationSqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter DestinationSqlInstance } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have SourceCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceCredential } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have DestinationCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have SharedPath as a parameter" { - $CommandUnderTest | Should -HaveParameter SharedPath -Type System.String + $CommandUnderTest | Should -HaveParameter SharedPath } It "Should have LocalPath as a parameter" { - $CommandUnderTest | Should -HaveParameter LocalPath -Type System.String + $CommandUnderTest | Should -HaveParameter LocalPath } It "Should have BackupJob as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupJob -Type System.String + $CommandUnderTest | Should -HaveParameter BackupJob } It "Should have BackupRetention as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupRetention -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BackupRetention } It "Should have BackupSchedule as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupSchedule -Type System.String + $CommandUnderTest | Should -HaveParameter BackupSchedule } It "Should have BackupScheduleDisabled as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupScheduleDisabled -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter BackupScheduleDisabled } It "Should have BackupScheduleFrequencyType as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupScheduleFrequencyType -Type System.Object + $CommandUnderTest | Should -HaveParameter BackupScheduleFrequencyType } It "Should have BackupScheduleFrequencyInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupScheduleFrequencyInterval -Type System.Object[] + $CommandUnderTest | Should -HaveParameter BackupScheduleFrequencyInterval } It "Should have BackupScheduleFrequencySubdayType as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupScheduleFrequencySubdayType -Type System.Object + $CommandUnderTest | Should -HaveParameter BackupScheduleFrequencySubdayType } It "Should have BackupScheduleFrequencySubdayInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupScheduleFrequencySubdayInterval -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BackupScheduleFrequencySubdayInterval } It "Should have BackupScheduleFrequencyRelativeInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupScheduleFrequencyRelativeInterval -Type System.Object + $CommandUnderTest | Should -HaveParameter BackupScheduleFrequencyRelativeInterval } It "Should have BackupScheduleFrequencyRecurrenceFactor as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupScheduleFrequencyRecurrenceFactor -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BackupScheduleFrequencyRecurrenceFactor } It "Should have BackupScheduleStartDate as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupScheduleStartDate -Type System.String + $CommandUnderTest | Should -HaveParameter BackupScheduleStartDate } It "Should have BackupScheduleEndDate as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupScheduleEndDate -Type System.String + $CommandUnderTest | Should -HaveParameter BackupScheduleEndDate } It "Should have BackupScheduleStartTime as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupScheduleStartTime -Type System.String + $CommandUnderTest | Should -HaveParameter BackupScheduleStartTime } It "Should have BackupScheduleEndTime as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupScheduleEndTime -Type System.String + $CommandUnderTest | Should -HaveParameter BackupScheduleEndTime } It "Should have BackupThreshold as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupThreshold -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BackupThreshold } It "Should have CompressBackup as a parameter" { - $CommandUnderTest | Should -HaveParameter CompressBackup -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter CompressBackup } It "Should have CopyDestinationFolder as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyDestinationFolder -Type System.String + $CommandUnderTest | Should -HaveParameter CopyDestinationFolder } It "Should have CopyJob as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyJob -Type System.String + $CommandUnderTest | Should -HaveParameter CopyJob } It "Should have CopyRetention as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyRetention -Type System.Int32 + $CommandUnderTest | Should -HaveParameter CopyRetention } It "Should have CopySchedule as a parameter" { - $CommandUnderTest | Should -HaveParameter CopySchedule -Type System.String + $CommandUnderTest | Should -HaveParameter CopySchedule } It "Should have CopyScheduleDisabled as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyScheduleDisabled -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter CopyScheduleDisabled } It "Should have CopyScheduleFrequencyType as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyScheduleFrequencyType -Type System.Object + $CommandUnderTest | Should -HaveParameter CopyScheduleFrequencyType } It "Should have CopyScheduleFrequencyInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyScheduleFrequencyInterval -Type System.Object[] + $CommandUnderTest | Should -HaveParameter CopyScheduleFrequencyInterval } It "Should have CopyScheduleFrequencySubdayType as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyScheduleFrequencySubdayType -Type System.Object + $CommandUnderTest | Should -HaveParameter CopyScheduleFrequencySubdayType } It "Should have CopyScheduleFrequencySubdayInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyScheduleFrequencySubdayInterval -Type System.Int32 + $CommandUnderTest | Should -HaveParameter CopyScheduleFrequencySubdayInterval } It "Should have CopyScheduleFrequencyRelativeInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyScheduleFrequencyRelativeInterval -Type System.Object + $CommandUnderTest | Should -HaveParameter CopyScheduleFrequencyRelativeInterval } It "Should have CopyScheduleFrequencyRecurrenceFactor as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyScheduleFrequencyRecurrenceFactor -Type System.Int32 + $CommandUnderTest | Should -HaveParameter CopyScheduleFrequencyRecurrenceFactor } It "Should have CopyScheduleStartDate as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyScheduleStartDate -Type System.String + $CommandUnderTest | Should -HaveParameter CopyScheduleStartDate } It "Should have CopyScheduleEndDate as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyScheduleEndDate -Type System.String + $CommandUnderTest | Should -HaveParameter CopyScheduleEndDate } It "Should have CopyScheduleStartTime as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyScheduleStartTime -Type System.String + $CommandUnderTest | Should -HaveParameter CopyScheduleStartTime } It "Should have CopyScheduleEndTime as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyScheduleEndTime -Type System.String + $CommandUnderTest | Should -HaveParameter CopyScheduleEndTime } It "Should have DisconnectUsers as a parameter" { - $CommandUnderTest | Should -HaveParameter DisconnectUsers -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DisconnectUsers } It "Should have FullBackupPath as a parameter" { - $CommandUnderTest | Should -HaveParameter FullBackupPath -Type System.String + $CommandUnderTest | Should -HaveParameter FullBackupPath } It "Should have GenerateFullBackup as a parameter" { - $CommandUnderTest | Should -HaveParameter GenerateFullBackup -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter GenerateFullBackup } It "Should have HistoryRetention as a parameter" { - $CommandUnderTest | Should -HaveParameter HistoryRetention -Type System.Int32 + $CommandUnderTest | Should -HaveParameter HistoryRetention } It "Should have NoRecovery as a parameter" { - $CommandUnderTest | Should -HaveParameter NoRecovery -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoRecovery } It "Should have NoInitialization as a parameter" { - $CommandUnderTest | Should -HaveParameter NoInitialization -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoInitialization } It "Should have PrimaryMonitorServer as a parameter" { - $CommandUnderTest | Should -HaveParameter PrimaryMonitorServer -Type System.String + $CommandUnderTest | Should -HaveParameter PrimaryMonitorServer } It "Should have PrimaryMonitorCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter PrimaryMonitorCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter PrimaryMonitorCredential } It "Should have PrimaryMonitorServerSecurityMode as a parameter" { - $CommandUnderTest | Should -HaveParameter PrimaryMonitorServerSecurityMode -Type System.Object + $CommandUnderTest | Should -HaveParameter PrimaryMonitorServerSecurityMode } It "Should have PrimaryThresholdAlertEnabled as a parameter" { - $CommandUnderTest | Should -HaveParameter PrimaryThresholdAlertEnabled -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter PrimaryThresholdAlertEnabled } It "Should have RestoreDataFolder as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreDataFolder -Type System.String + $CommandUnderTest | Should -HaveParameter RestoreDataFolder } It "Should have RestoreLogFolder as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreLogFolder -Type System.String + $CommandUnderTest | Should -HaveParameter RestoreLogFolder } It "Should have RestoreDelay as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreDelay -Type System.Int32 + $CommandUnderTest | Should -HaveParameter RestoreDelay } It "Should have RestoreAlertThreshold as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreAlertThreshold -Type System.Int32 + $CommandUnderTest | Should -HaveParameter RestoreAlertThreshold } It "Should have RestoreJob as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreJob -Type System.String + $CommandUnderTest | Should -HaveParameter RestoreJob } It "Should have RestoreRetention as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreRetention -Type System.Int32 + $CommandUnderTest | Should -HaveParameter RestoreRetention } It "Should have RestoreSchedule as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreSchedule -Type System.String + $CommandUnderTest | Should -HaveParameter RestoreSchedule } It "Should have RestoreScheduleDisabled as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreScheduleDisabled -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter RestoreScheduleDisabled } It "Should have RestoreScheduleFrequencyType as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreScheduleFrequencyType -Type System.Object + $CommandUnderTest | Should -HaveParameter RestoreScheduleFrequencyType } It "Should have RestoreScheduleFrequencyInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreScheduleFrequencyInterval -Type System.Object[] + $CommandUnderTest | Should -HaveParameter RestoreScheduleFrequencyInterval } It "Should have RestoreScheduleFrequencySubdayType as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreScheduleFrequencySubdayType -Type System.Object + $CommandUnderTest | Should -HaveParameter RestoreScheduleFrequencySubdayType } It "Should have RestoreScheduleFrequencySubdayInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreScheduleFrequencySubdayInterval -Type System.Int32 + $CommandUnderTest | Should -HaveParameter RestoreScheduleFrequencySubdayInterval } It "Should have RestoreScheduleFrequencyRelativeInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreScheduleFrequencyRelativeInterval -Type System.Object + $CommandUnderTest | Should -HaveParameter RestoreScheduleFrequencyRelativeInterval } It "Should have RestoreScheduleFrequencyRecurrenceFactor as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreScheduleFrequencyRecurrenceFactor -Type System.Int32 + $CommandUnderTest | Should -HaveParameter RestoreScheduleFrequencyRecurrenceFactor } It "Should have RestoreScheduleStartDate as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreScheduleStartDate -Type System.String + $CommandUnderTest | Should -HaveParameter RestoreScheduleStartDate } It "Should have RestoreScheduleEndDate as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreScheduleEndDate -Type System.String + $CommandUnderTest | Should -HaveParameter RestoreScheduleEndDate } It "Should have RestoreScheduleStartTime as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreScheduleStartTime -Type System.String + $CommandUnderTest | Should -HaveParameter RestoreScheduleStartTime } It "Should have RestoreScheduleEndTime as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreScheduleEndTime -Type System.String + $CommandUnderTest | Should -HaveParameter RestoreScheduleEndTime } It "Should have RestoreThreshold as a parameter" { - $CommandUnderTest | Should -HaveParameter RestoreThreshold -Type System.Int32 + $CommandUnderTest | Should -HaveParameter RestoreThreshold } It "Should have SecondaryDatabasePrefix as a parameter" { - $CommandUnderTest | Should -HaveParameter SecondaryDatabasePrefix -Type System.String + $CommandUnderTest | Should -HaveParameter SecondaryDatabasePrefix } It "Should have SecondaryDatabaseSuffix as a parameter" { - $CommandUnderTest | Should -HaveParameter SecondaryDatabaseSuffix -Type System.String + $CommandUnderTest | Should -HaveParameter SecondaryDatabaseSuffix } It "Should have SecondaryMonitorServer as a parameter" { - $CommandUnderTest | Should -HaveParameter SecondaryMonitorServer -Type System.String + $CommandUnderTest | Should -HaveParameter SecondaryMonitorServer } It "Should have SecondaryMonitorCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SecondaryMonitorCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SecondaryMonitorCredential } It "Should have SecondaryMonitorServerSecurityMode as a parameter" { - $CommandUnderTest | Should -HaveParameter SecondaryMonitorServerSecurityMode -Type System.Object + $CommandUnderTest | Should -HaveParameter SecondaryMonitorServerSecurityMode } It "Should have SecondaryThresholdAlertEnabled as a parameter" { - $CommandUnderTest | Should -HaveParameter SecondaryThresholdAlertEnabled -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter SecondaryThresholdAlertEnabled } It "Should have Standby as a parameter" { - $CommandUnderTest | Should -HaveParameter Standby -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Standby } It "Should have StandbyDirectory as a parameter" { - $CommandUnderTest | Should -HaveParameter StandbyDirectory -Type System.String + $CommandUnderTest | Should -HaveParameter StandbyDirectory } It "Should have UseExistingFullBackup as a parameter" { - $CommandUnderTest | Should -HaveParameter UseExistingFullBackup -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter UseExistingFullBackup } It "Should have UseBackupFolder as a parameter" { - $CommandUnderTest | Should -HaveParameter UseBackupFolder -Type System.String + $CommandUnderTest | Should -HaveParameter UseBackupFolder } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbaDbMirrorFailover.Tests.ps1 b/tests/Invoke-DbaDbMirrorFailover.Tests.ps1 index e0bae5472f..abe283b4b4 100644 --- a/tests/Invoke-DbaDbMirrorFailover.Tests.ps1 +++ b/tests/Invoke-DbaDbMirrorFailover.Tests.ps1 @@ -10,22 +10,22 @@ Describe "Invoke-DbaDbMirrorFailover" { $CommandUnderTest = Get-Command Invoke-DbaDbMirrorFailover } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Force as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbaDbMirroring.Tests.ps1 b/tests/Invoke-DbaDbMirroring.Tests.ps1 index 43d7723989..8b2eb196a7 100644 --- a/tests/Invoke-DbaDbMirroring.Tests.ps1 +++ b/tests/Invoke-DbaDbMirroring.Tests.ps1 @@ -12,46 +12,46 @@ Describe "Invoke-DbaDbMirroring" { $CommandUnderTest = Get-Command Invoke-DbaDbMirroring } It "Should have Primary parameter" { - $CommandUnderTest | Should -HaveParameter Primary -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Primary } It "Should have PrimarySqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter PrimarySqlCredential -Type Microsoft.SqlServer.Management.Smo.PSCredential + $CommandUnderTest | Should -HaveParameter PrimarySqlCredential } It "Should have Mirror parameter" { - $CommandUnderTest | Should -HaveParameter Mirror -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Mirror } It "Should have MirrorSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter MirrorSqlCredential -Type Microsoft.SqlServer.Management.Smo.PSCredential + $CommandUnderTest | Should -HaveParameter MirrorSqlCredential } It "Should have Witness parameter" { - $CommandUnderTest | Should -HaveParameter Witness -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Witness } It "Should have WitnessSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter WitnessSqlCredential -Type Microsoft.SqlServer.Management.Smo.PSCredential + $CommandUnderTest | Should -HaveParameter WitnessSqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have EndpointEncryption parameter" { - $CommandUnderTest | Should -HaveParameter EndpointEncryption -Type System.String + $CommandUnderTest | Should -HaveParameter EndpointEncryption } It "Should have EncryptionAlgorithm parameter" { - $CommandUnderTest | Should -HaveParameter EncryptionAlgorithm -Type System.String + $CommandUnderTest | Should -HaveParameter EncryptionAlgorithm } It "Should have SharedPath parameter" { - $CommandUnderTest | Should -HaveParameter SharedPath -Type System.String + $CommandUnderTest | Should -HaveParameter SharedPath } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have UseLastBackup parameter" { - $CommandUnderTest | Should -HaveParameter UseLastBackup -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter UseLastBackup } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbaDbPiiScan.Tests.ps1 b/tests/Invoke-DbaDbPiiScan.Tests.ps1 index 5967d528bc..84d063058b 100644 --- a/tests/Invoke-DbaDbPiiScan.Tests.ps1 +++ b/tests/Invoke-DbaDbPiiScan.Tests.ps1 @@ -12,49 +12,49 @@ Describe "Invoke-DbaDbPiiScan Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Invoke-DbaDbPiiScan } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Table as a parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Table } It "Should have Column as a parameter" { - $CommandUnderTest | Should -HaveParameter Column -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Column } It "Should have Country as a parameter" { - $CommandUnderTest | Should -HaveParameter Country -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Country } It "Should have CountryCode as a parameter" { - $CommandUnderTest | Should -HaveParameter CountryCode -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CountryCode } It "Should have ExcludeTable as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeTable -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeTable } It "Should have ExcludeColumn as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeColumn -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeColumn } It "Should have SampleCount as a parameter" { - $CommandUnderTest | Should -HaveParameter SampleCount -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SampleCount } It "Should have KnownNameFilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter KnownNameFilePath -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter KnownNameFilePath } It "Should have PatternFilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter PatternFilePath -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PatternFilePath } It "Should have ExcludeDefaultKnownName as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDefaultKnownName -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDefaultKnownName } It "Should have ExcludeDefaultPattern as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDefaultPattern -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDefaultPattern } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Invoke-DbaDbShrink.Tests.ps1 b/tests/Invoke-DbaDbShrink.Tests.ps1 index e6e7a29dfe..2689009b8c 100644 --- a/tests/Invoke-DbaDbShrink.Tests.ps1 +++ b/tests/Invoke-DbaDbShrink.Tests.ps1 @@ -12,43 +12,43 @@ Describe "Invoke-DbaDbShrink Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Invoke-DbaDbShrink } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have AllUserDatabases parameter" { - $CommandUnderTest | Should -HaveParameter AllUserDatabases -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AllUserDatabases } It "Should have PercentFreeSpace parameter" { - $CommandUnderTest | Should -HaveParameter PercentFreeSpace -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PercentFreeSpace } It "Should have ShrinkMethod parameter" { - $CommandUnderTest | Should -HaveParameter ShrinkMethod -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ShrinkMethod } It "Should have FileType parameter" { - $CommandUnderTest | Should -HaveParameter FileType -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FileType } It "Should have StepSize parameter" { - $CommandUnderTest | Should -HaveParameter StepSize -Type System.Int64 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter StepSize } It "Should have StatementTimeout parameter" { - $CommandUnderTest | Should -HaveParameter StatementTimeout -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter StatementTimeout } It "Should have ExcludeIndexStats parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeIndexStats -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeIndexStats } It "Should have ExcludeUpdateUsage parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeUpdateUsage -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeUpdateUsage } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Invoke-DbaDbTransfer.Tests.ps1 b/tests/Invoke-DbaDbTransfer.Tests.ps1 index 51967c210b..8feb18647b 100644 --- a/tests/Invoke-DbaDbTransfer.Tests.ps1 +++ b/tests/Invoke-DbaDbTransfer.Tests.ps1 @@ -43,52 +43,52 @@ Describe "Invoke-DbaDbTransfer" { $CommandUnderTest = Get-Command Invoke-DbaDbTransfer } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have DestinationSqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlInstance -Type DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter DestinationSqlInstance } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have DestinationDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationDatabase -Type System.String + $CommandUnderTest | Should -HaveParameter DestinationDatabase } It "Should have BatchSize as a parameter" { - $CommandUnderTest | Should -HaveParameter BatchSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BatchSize } It "Should have BulkCopyTimeOut as a parameter" { - $CommandUnderTest | Should -HaveParameter BulkCopyTimeOut -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BulkCopyTimeOut } It "Should have ScriptingOption as a parameter" { - $CommandUnderTest | Should -HaveParameter ScriptingOption -Type Microsoft.SqlServer.Management.Smo.ScriptingOptions + $CommandUnderTest | Should -HaveParameter ScriptingOption } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Transfer + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have CopyAllObjects as a switch parameter" { - $CommandUnderTest | Should -HaveParameter CopyAllObjects -Type Switch + $CommandUnderTest | Should -HaveParameter CopyAllObjects } It "Should have CopyAll as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyAll -Type String[] + $CommandUnderTest | Should -HaveParameter CopyAll } It "Should have SchemaOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter SchemaOnly -Type Switch + $CommandUnderTest | Should -HaveParameter SchemaOnly } It "Should have DataOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DataOnly -Type Switch + $CommandUnderTest | Should -HaveParameter DataOnly } It "Should have ScriptOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ScriptOnly -Type Switch + $CommandUnderTest | Should -HaveParameter ScriptOnly } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbaDbUpgrade.Tests.ps1 b/tests/Invoke-DbaDbUpgrade.Tests.ps1 index 84126268da..7e3ca548fc 100644 --- a/tests/Invoke-DbaDbUpgrade.Tests.ps1 +++ b/tests/Invoke-DbaDbUpgrade.Tests.ps1 @@ -10,40 +10,40 @@ Describe "Invoke-DbaDbUpgrade" { $CommandUnderTest = Get-Command Invoke-DbaDbUpgrade } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have NoCheckDb parameter" { - $CommandUnderTest | Should -HaveParameter NoCheckDb -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoCheckDb } It "Should have NoUpdateUsage parameter" { - $CommandUnderTest | Should -HaveParameter NoUpdateUsage -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoUpdateUsage } It "Should have NoUpdateStats parameter" { - $CommandUnderTest | Should -HaveParameter NoUpdateStats -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoUpdateStats } It "Should have NoRefreshView parameter" { - $CommandUnderTest | Should -HaveParameter NoRefreshView -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoRefreshView } It "Should have AllUserDatabases parameter" { - $CommandUnderTest | Should -HaveParameter AllUserDatabases -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AllUserDatabases } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Invoke-DbaDbccDropCleanBuffer.Tests.ps1 b/tests/Invoke-DbaDbccDropCleanBuffer.Tests.ps1 index cb8cac0734..d77c1f496b 100644 --- a/tests/Invoke-DbaDbccDropCleanBuffer.Tests.ps1 +++ b/tests/Invoke-DbaDbccDropCleanBuffer.Tests.ps1 @@ -11,16 +11,16 @@ Describe "Invoke-DbaDbccDropCleanBuffer" { $CommandUnderTest = Get-Command Invoke-DbaDbccDropCleanBuffer } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have NoInformationalMessages as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoInformationalMessages -Type switch + $CommandUnderTest | Should -HaveParameter NoInformationalMessages } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbaDbccFreeCache.Tests.ps1 b/tests/Invoke-DbaDbccFreeCache.Tests.ps1 index d04bceabc4..2559e639e6 100644 --- a/tests/Invoke-DbaDbccFreeCache.Tests.ps1 +++ b/tests/Invoke-DbaDbccFreeCache.Tests.ps1 @@ -11,25 +11,25 @@ Describe "Invoke-DbaDbccFreeCache" { $CommandUnderTest = Get-Command Invoke-DbaDbccFreeCache } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Operation as a parameter" { - $CommandUnderTest | Should -HaveParameter Operation -Type System.String + $CommandUnderTest | Should -HaveParameter Operation } It "Should have InputValue as a parameter" { - $CommandUnderTest | Should -HaveParameter InputValue -Type System.String + $CommandUnderTest | Should -HaveParameter InputValue } It "Should have NoInformationalMessages as a parameter" { - $CommandUnderTest | Should -HaveParameter NoInformationalMessages -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoInformationalMessages } It "Should have MarkInUseForRemoval as a parameter" { - $CommandUnderTest | Should -HaveParameter MarkInUseForRemoval -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter MarkInUseForRemoval } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -39,7 +39,7 @@ Describe "Invoke-DbaDbccFreeCache" { } It "returns the right results for FREESYSTEMCACHE" { - $result = Invoke-DbaDbccFreeCache -SqlInstance $global:instance2 -Operation FreeSystemCache -Confirm:$false + $result = Invoke-DbaDbccFreeCache -SqlInstance $global:instance2 -Operation FreeSystemCache $result.Operation | Should -Match 'FREESYSTEMCACHE' $result.Output | Should -Match 'DBCC execution completed. If DBCC printed error messages, contact your system administrator.' foreach ($prop in $props) { @@ -48,19 +48,19 @@ Describe "Invoke-DbaDbccFreeCache" { } It "returns the right results for FREESESSIONCACHE" { - $result = Invoke-DbaDbccFreeCache -SqlInstance $global:instance2 -Operation FreeSessionCache -Confirm:$false + $result = Invoke-DbaDbccFreeCache -SqlInstance $global:instance2 -Operation FreeSessionCache $result.Operation | Should -Match 'FREESESSIONCACHE' $result.Output | Should -Match 'DBCC execution completed. If DBCC printed error messages, contact your system administrator.' } It "returns the right results for FREEPROCCACHE" { - $result = Invoke-DbaDbccFreeCache -SqlInstance $global:instance2 -Operation FREEPROCCACHE -Confirm:$false + $result = Invoke-DbaDbccFreeCache -SqlInstance $global:instance2 -Operation FREEPROCCACHE $result.Operation | Should -Match 'FREEPROCCACHE' $result.Output | Should -Match 'DBCC execution completed. If DBCC printed error messages, contact your system administrator.' } It "returns the right results for FREESESSIONCACHE and using NoInformationalMessages" { - $result = Invoke-DbaDbccFreeCache -SqlInstance $global:instance2 -Operation FreeSessionCache -NoInformationalMessages -Confirm:$false + $result = Invoke-DbaDbccFreeCache -SqlInstance $global:instance2 -Operation FreeSessionCache -NoInformationalMessages $result.Operation | Should -Match 'FREESESSIONCACHE' $result.Output | Should -BeNullOrEmpty } diff --git a/tests/Invoke-DbaDiagnosticQuery.Tests.ps1 b/tests/Invoke-DbaDiagnosticQuery.Tests.ps1 index c862485b3c..1c3ed69c3b 100644 --- a/tests/Invoke-DbaDiagnosticQuery.Tests.ps1 +++ b/tests/Invoke-DbaDiagnosticQuery.Tests.ps1 @@ -39,52 +39,52 @@ Describe "Invoke-DbaDiagnosticQuery" { $CommandUnderTest = Get-Command Invoke-DbaDiagnosticQuery } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have ExcludeQuery as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeQuery -Type Microsoft.SqlServer.Management.Smo.SqlSmoObject[] + $CommandUnderTest | Should -HaveParameter ExcludeQuery } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.IO.FileInfo + $CommandUnderTest | Should -HaveParameter Path } It "Should have QueryName as a parameter" { - $CommandUnderTest | Should -HaveParameter QueryName -Type System.String[] + $CommandUnderTest | Should -HaveParameter QueryName } It "Should have UseSelectionHelper as a switch parameter" { - $CommandUnderTest | Should -HaveParameter UseSelectionHelper -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter UseSelectionHelper } It "Should have InstanceOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter InstanceOnly -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter InstanceOnly } It "Should have DatabaseSpecific as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DatabaseSpecific -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DatabaseSpecific } It "Should have ExcludeQueryTextColumn as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeQueryTextColumn -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeQueryTextColumn } It "Should have ExcludePlanColumn as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludePlanColumn -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludePlanColumn } It "Should have NoColumnParsing as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoColumnParsing -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoColumnParsing } It "Should have OutputPath as a parameter" { - $CommandUnderTest | Should -HaveParameter OutputPath -Type System.String + $CommandUnderTest | Should -HaveParameter OutputPath } It "Should have ExportQueries as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExportQueries -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExportQueries } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbaPfRelog.Tests.ps1 b/tests/Invoke-DbaPfRelog.Tests.ps1 index 41c77db2e6..ebba87d4d9 100644 --- a/tests/Invoke-DbaPfRelog.Tests.ps1 +++ b/tests/Invoke-DbaPfRelog.Tests.ps1 @@ -11,56 +11,56 @@ Describe "Invoke-DbaPfRelog Unit Tests" -Tag 'UnitTests' { BeforeAll { $CommandUnderTest = Get-Command Invoke-DbaPfRelog } - It "Should have Path as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String[] -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } - It "Should have Destination as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type System.String -Mandatory:$false + It "Should have Destination as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Destination } - It "Should have Type as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String -Mandatory:$false + It "Should have Type as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Type } - It "Should have Append as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have Append as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Append } - It "Should have AllowClobber as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter AllowClobber -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have AllowClobber as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter AllowClobber } - It "Should have PerformanceCounter as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter PerformanceCounter -Type System.String[] -Mandatory:$false + It "Should have PerformanceCounter as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter PerformanceCounter } - It "Should have PerformanceCounterPath as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter PerformanceCounterPath -Type System.String -Mandatory:$false + It "Should have PerformanceCounterPath as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter PerformanceCounterPath } - It "Should have Interval as a non-mandatory System.Int32 parameter" { - $CommandUnderTest | Should -HaveParameter Interval -Type System.Int32 -Mandatory:$false + It "Should have Interval as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Interval } - It "Should have BeginTime as a non-mandatory System.DateTime parameter" { - $CommandUnderTest | Should -HaveParameter BeginTime -Type System.DateTime -Mandatory:$false + It "Should have BeginTime as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter BeginTime } - It "Should have EndTime as a non-mandatory System.DateTime parameter" { - $CommandUnderTest | Should -HaveParameter EndTime -Type System.DateTime -Mandatory:$false + It "Should have EndTime as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter EndTime } - It "Should have ConfigPath as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter ConfigPath -Type System.String -Mandatory:$false + It "Should have ConfigPath as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ConfigPath } - It "Should have Summary as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter Summary -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have Summary as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Summary } - It "Should have InputObject as a non-mandatory System.Object[] parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } - It "Should have Multithread as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter Multithread -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have Multithread as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Multithread } - It "Should have AllTime as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter AllTime -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have AllTime as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter AllTime } - It "Should have Raw as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter Raw -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have Raw as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Raw } - It "Should have EnableException as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have EnableException as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Invoke-DbaQuery.Tests.ps1 b/tests/Invoke-DbaQuery.Tests.ps1 index ec49624dc5..2420fc6f4f 100644 --- a/tests/Invoke-DbaQuery.Tests.ps1 +++ b/tests/Invoke-DbaQuery.Tests.ps1 @@ -25,52 +25,52 @@ Describe "Invoke-DbaQuery" { $CommandUnderTest = Get-Command Invoke-DbaQuery } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Query parameter" { - $CommandUnderTest | Should -HaveParameter Query -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Query } It "Should have QueryTimeout parameter" { - $CommandUnderTest | Should -HaveParameter QueryTimeout -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter QueryTimeout } It "Should have File parameter" { - $CommandUnderTest | Should -HaveParameter File -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter File } It "Should have SqlObject parameter" { - $CommandUnderTest | Should -HaveParameter SqlObject -Type Microsoft.SqlServer.Management.Smo.SqlSmoObject[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlObject } It "Should have As parameter" { - $CommandUnderTest | Should -HaveParameter As -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter As } It "Should have SqlParameter parameter" { - $CommandUnderTest | Should -HaveParameter SqlParameter -Type System.Management.Automation.PSObject[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlParameter } It "Should have CommandType parameter" { - $CommandUnderTest | Should -HaveParameter CommandType -Type System.Data.CommandType -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CommandType } It "Should have AppendServerInstance parameter" { - $CommandUnderTest | Should -HaveParameter AppendServerInstance -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AppendServerInstance } It "Should have MessagesToOutput parameter" { - $CommandUnderTest | Should -HaveParameter MessagesToOutput -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MessagesToOutput } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have ReadOnly parameter" { - $CommandUnderTest | Should -HaveParameter ReadOnly -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ReadOnly } It "Should have NoExec parameter" { - $CommandUnderTest | Should -HaveParameter NoExec -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoExec } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbaWhoisActive.Tests.ps1 b/tests/Invoke-DbaWhoisActive.Tests.ps1 index 6352f7aa9e..15963c5d4d 100644 --- a/tests/Invoke-DbaWhoisActive.Tests.ps1 +++ b/tests/Invoke-DbaWhoisActive.Tests.ps1 @@ -21,91 +21,91 @@ Describe "Invoke-DbaWhoIsActive" { $CommandUnderTest = Get-Command Invoke-DbaWhoIsActive } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have Filter as a parameter" { - $CommandUnderTest | Should -HaveParameter Filter -Type System.String + $CommandUnderTest | Should -HaveParameter Filter } It "Should have FilterType as a parameter" { - $CommandUnderTest | Should -HaveParameter FilterType -Type System.String + $CommandUnderTest | Should -HaveParameter FilterType } It "Should have NotFilter as a parameter" { - $CommandUnderTest | Should -HaveParameter NotFilter -Type System.String + $CommandUnderTest | Should -HaveParameter NotFilter } It "Should have NotFilterType as a parameter" { - $CommandUnderTest | Should -HaveParameter NotFilterType -Type System.String + $CommandUnderTest | Should -HaveParameter NotFilterType } It "Should have ShowOwnSpid as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ShowOwnSpid -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ShowOwnSpid } It "Should have ShowSystemSpids as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ShowSystemSpids -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ShowSystemSpids } It "Should have ShowSleepingSpids as a parameter" { - $CommandUnderTest | Should -HaveParameter ShowSleepingSpids -Type System.Int32 + $CommandUnderTest | Should -HaveParameter ShowSleepingSpids } It "Should have GetFullInnerText as a switch parameter" { - $CommandUnderTest | Should -HaveParameter GetFullInnerText -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter GetFullInnerText } It "Should have GetPlans as a parameter" { - $CommandUnderTest | Should -HaveParameter GetPlans -Type System.Int32 + $CommandUnderTest | Should -HaveParameter GetPlans } It "Should have GetOuterCommand as a switch parameter" { - $CommandUnderTest | Should -HaveParameter GetOuterCommand -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter GetOuterCommand } It "Should have GetTransactionInfo as a switch parameter" { - $CommandUnderTest | Should -HaveParameter GetTransactionInfo -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter GetTransactionInfo } It "Should have GetTaskInfo as a parameter" { - $CommandUnderTest | Should -HaveParameter GetTaskInfo -Type System.Int32 + $CommandUnderTest | Should -HaveParameter GetTaskInfo } It "Should have GetLocks as a switch parameter" { - $CommandUnderTest | Should -HaveParameter GetLocks -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter GetLocks } It "Should have GetAverageTime as a switch parameter" { - $CommandUnderTest | Should -HaveParameter GetAverageTime -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter GetAverageTime } It "Should have GetAdditonalInfo as a switch parameter" { - $CommandUnderTest | Should -HaveParameter GetAdditonalInfo -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter GetAdditonalInfo } It "Should have FindBlockLeaders as a switch parameter" { - $CommandUnderTest | Should -HaveParameter FindBlockLeaders -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter FindBlockLeaders } It "Should have DeltaInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter DeltaInterval -Type System.Int32 + $CommandUnderTest | Should -HaveParameter DeltaInterval } It "Should have OutputColumnList as a parameter" { - $CommandUnderTest | Should -HaveParameter OutputColumnList -Type System.String + $CommandUnderTest | Should -HaveParameter OutputColumnList } It "Should have SortOrder as a parameter" { - $CommandUnderTest | Should -HaveParameter SortOrder -Type System.String + $CommandUnderTest | Should -HaveParameter SortOrder } It "Should have FormatOutput as a parameter" { - $CommandUnderTest | Should -HaveParameter FormatOutput -Type System.Int32 + $CommandUnderTest | Should -HaveParameter FormatOutput } It "Should have DestinationTable as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationTable -Type System.String + $CommandUnderTest | Should -HaveParameter DestinationTable } It "Should have ReturnSchema as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ReturnSchema -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ReturnSchema } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String + $CommandUnderTest | Should -HaveParameter Schema } It "Should have Help as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Help -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Help } It "Should have As as a parameter" { - $CommandUnderTest | Should -HaveParameter As -Type System.String + $CommandUnderTest | Should -HaveParameter As } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbaXEReplay.Tests.ps1 b/tests/Invoke-DbaXEReplay.Tests.ps1 index 148e6fb2fe..227e090138 100644 --- a/tests/Invoke-DbaXEReplay.Tests.ps1 +++ b/tests/Invoke-DbaXEReplay.Tests.ps1 @@ -10,25 +10,25 @@ Describe "Invoke-DbaXEReplay" { $CommandUnderTest = Get-Command Invoke-DbaXEReplay } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Event parameter" { - $CommandUnderTest | Should -HaveParameter Event -Type System.String[] + $CommandUnderTest | Should -HaveParameter Event } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Raw parameter" { - $CommandUnderTest | Should -HaveParameter Raw -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Raw } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbatoolsFormatter.Tests.ps1 b/tests/Invoke-DbatoolsFormatter.Tests.ps1 index 083afb06eb..161f934c3a 100644 --- a/tests/Invoke-DbatoolsFormatter.Tests.ps1 +++ b/tests/Invoke-DbatoolsFormatter.Tests.ps1 @@ -44,10 +44,10 @@ function Get-DbaStub { $CommandUnderTest = Get-Command Invoke-DbatoolsFormatter } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Invoke-DbatoolsRenameHelper.Tests.ps1 b/tests/Invoke-DbatoolsRenameHelper.Tests.ps1 index bc9443fc62..47b8fbcbb4 100644 --- a/tests/Invoke-DbatoolsRenameHelper.Tests.ps1 +++ b/tests/Invoke-DbatoolsRenameHelper.Tests.ps1 @@ -48,13 +48,13 @@ function Get-DbaStub { $CommandUnderTest = Get-Command Invoke-DbatoolsRenameHelper } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.FileInfo[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Encoding as a parameter" { - $CommandUnderTest | Should -HaveParameter Encoding -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Encoding } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Join-DbaAvailabilityGroup.Tests.ps1 b/tests/Join-DbaAvailabilityGroup.Tests.ps1 index aeb0454e02..e13f23a33a 100644 --- a/tests/Join-DbaAvailabilityGroup.Tests.ps1 +++ b/tests/Join-DbaAvailabilityGroup.Tests.ps1 @@ -10,22 +10,22 @@ Describe "Join-DbaAvailabilityGroup" { $CommandUnderTest = Get-Command Join-DbaAvailabilityGroup } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String[] + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have ClusterType as a parameter" { - $CommandUnderTest | Should -HaveParameter ClusterType -Type System.String + $CommandUnderTest | Should -HaveParameter ClusterType } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityGroup[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Join-DbaPath.Tests.ps1 b/tests/Join-DbaPath.Tests.ps1 index d4d8460a5a..85957fc207 100644 --- a/tests/Join-DbaPath.Tests.ps1 +++ b/tests/Join-DbaPath.Tests.ps1 @@ -10,13 +10,13 @@ Describe "Join-DbaPath" { $CommandUnderTest = Get-Command Join-DbaPath } It "Should have Path as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have SqlInstance as a non-mandatory DbaInstanceParameter parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Child as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Child -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Child } } diff --git a/tests/Measure-DbaBackupThroughput.Tests.ps1 b/tests/Measure-DbaBackupThroughput.Tests.ps1 index 5e8d3c1cfb..bcf8ed7987 100644 --- a/tests/Measure-DbaBackupThroughput.Tests.ps1 +++ b/tests/Measure-DbaBackupThroughput.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Measure-DbaBackupThroughput" { $CommandUnderTest = Get-Command Measure-DbaBackupThroughput } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Since parameter" { - $CommandUnderTest | Should -HaveParameter Since -Type DateTime -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Since } It "Should have Last parameter" { - $CommandUnderTest | Should -HaveParameter Last -Type Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Last } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type } It "Should have DeviceType parameter" { - $CommandUnderTest | Should -HaveParameter DeviceType -Type String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DeviceType } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Measure-DbaDbVirtualLogFile.Tests.ps1 b/tests/Measure-DbaDbVirtualLogFile.Tests.ps1 index ec82e32999..7790a948a0 100644 --- a/tests/Measure-DbaDbVirtualLogFile.Tests.ps1 +++ b/tests/Measure-DbaDbVirtualLogFile.Tests.ps1 @@ -10,23 +10,23 @@ Describe "Measure-DbaDbVirtualLogFile" { BeforeAll { $CommandUnderTest = Get-Command Measure-DbaDbVirtualLogFile } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have ExcludeDatabase as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + It "Should have ExcludeDatabase as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have IncludeSystemDBs as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemDBs -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeSystemDBs } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Measure-DbaDiskSpaceRequirement.Tests.ps1 b/tests/Measure-DbaDiskSpaceRequirement.Tests.ps1 index fea95b89cb..1cfe92a51f 100644 --- a/tests/Measure-DbaDiskSpaceRequirement.Tests.ps1 +++ b/tests/Measure-DbaDiskSpaceRequirement.Tests.ps1 @@ -11,28 +11,28 @@ Describe "Measure-DbaDiskSpaceRequirement" { $CommandUnderTest = Get-Command Measure-DbaDiskSpaceRequirement } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationDatabase -Type System.String + $CommandUnderTest | Should -HaveParameter DestinationDatabase } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Mount-DbaDatabase.Tests.ps1 b/tests/Mount-DbaDatabase.Tests.ps1 index b4594c75b9..259cef80be 100644 --- a/tests/Mount-DbaDatabase.Tests.ps1 +++ b/tests/Mount-DbaDatabase.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Mount-DbaDatabase" { $CommandUnderTest = Get-Command Mount-DbaDatabase } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have FileStructure as a parameter" { - $CommandUnderTest | Should -HaveParameter FileStructure -Type System.Collections.Specialized.StringCollection + $CommandUnderTest | Should -HaveParameter FileStructure } It "Should have DatabaseOwner as a parameter" { - $CommandUnderTest | Should -HaveParameter DatabaseOwner -Type System.String + $CommandUnderTest | Should -HaveParameter DatabaseOwner } It "Should have AttachOption as a parameter" { - $CommandUnderTest | Should -HaveParameter AttachOption -Type System.String + $CommandUnderTest | Should -HaveParameter AttachOption } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Move-DbaDbFile.Tests.ps1 b/tests/Move-DbaDbFile.Tests.ps1 index 65686877cc..31b91f7f3b 100644 --- a/tests/Move-DbaDbFile.Tests.ps1 +++ b/tests/Move-DbaDbFile.Tests.ps1 @@ -37,34 +37,34 @@ Describe "Move-DbaDbFile" { $CommandUnderTest = Get-Command Move-DbaDbFile } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have FileType as a parameter" { - $CommandUnderTest | Should -HaveParameter FileType -Type System.String + $CommandUnderTest | Should -HaveParameter FileType } It "Should have FileDestination as a parameter" { - $CommandUnderTest | Should -HaveParameter FileDestination -Type System.String + $CommandUnderTest | Should -HaveParameter FileDestination } It "Should have FileToMove as a parameter" { - $CommandUnderTest | Should -HaveParameter FileToMove -Type System.Collections.Hashtable + $CommandUnderTest | Should -HaveParameter FileToMove } It "Should have DeleteAfterMove as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DeleteAfterMove -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DeleteAfterMove } It "Should have FileStructureOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter FileStructureOnly -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter FileStructureOnly } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Move-DbaRegServer.Tests.ps1 b/tests/Move-DbaRegServer.Tests.ps1 index 7944926298..d12b821e8a 100644 --- a/tests/Move-DbaRegServer.Tests.ps1 +++ b/tests/Move-DbaRegServer.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Move-DbaRegServer" { $CommandUnderTest = Get-Command Move-DbaRegServer } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] + $CommandUnderTest | Should -HaveParameter Name } It "Should have ServerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ServerName -Type System.String[] + $CommandUnderTest | Should -HaveParameter ServerName } It "Should have Group as a parameter" { - $CommandUnderTest | Should -HaveParameter Group -Type System.String + $CommandUnderTest | Should -HaveParameter Group } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.RegisteredServers.RegisteredServer[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Move-DbaRegServerGroup.Tests.ps1 b/tests/Move-DbaRegServerGroup.Tests.ps1 index a315c418d0..f66481bc13 100644 --- a/tests/Move-DbaRegServerGroup.Tests.ps1 +++ b/tests/Move-DbaRegServerGroup.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Move-DbaRegServerGroup" { $CommandUnderTest = Get-Command Move-DbaRegServerGroup } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Group as a parameter" { - $CommandUnderTest | Should -HaveParameter Group -Type System.String[] + $CommandUnderTest | Should -HaveParameter Group } It "Should have NewGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter NewGroup -Type System.String + $CommandUnderTest | Should -HaveParameter NewGroup } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.RegisteredServers.ServerGroup[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaAgentAlert.Tests.ps1 b/tests/New-DbaAgentAlert.Tests.ps1 index b969324416..e1b3687ecd 100644 --- a/tests/New-DbaAgentAlert.Tests.ps1 +++ b/tests/New-DbaAgentAlert.Tests.ps1 @@ -25,61 +25,61 @@ Describe "New-DbaAgentAlert" { $CommandUnderTest = Get-Command New-DbaAgentAlert } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Alert parameter" { - $CommandUnderTest | Should -HaveParameter Alert -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Alert } It "Should have Category parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Category } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Operator parameter" { - $CommandUnderTest | Should -HaveParameter Operator -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Operator } It "Should have DelayBetweenResponses parameter" { - $CommandUnderTest | Should -HaveParameter DelayBetweenResponses -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DelayBetweenResponses } It "Should have Disabled parameter" { - $CommandUnderTest | Should -HaveParameter Disabled -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Disabled } It "Should have EventDescriptionKeyword parameter" { - $CommandUnderTest | Should -HaveParameter EventDescriptionKeyword -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EventDescriptionKeyword } It "Should have EventSource parameter" { - $CommandUnderTest | Should -HaveParameter EventSource -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EventSource } It "Should have JobId parameter" { - $CommandUnderTest | Should -HaveParameter JobId -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter JobId } It "Should have Severity parameter" { - $CommandUnderTest | Should -HaveParameter Severity -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Severity } It "Should have MessageId parameter" { - $CommandUnderTest | Should -HaveParameter MessageId -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MessageId } It "Should have NotificationMessage parameter" { - $CommandUnderTest | Should -HaveParameter NotificationMessage -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NotificationMessage } It "Should have PerformanceCondition parameter" { - $CommandUnderTest | Should -HaveParameter PerformanceCondition -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PerformanceCondition } It "Should have WmiEventNamespace parameter" { - $CommandUnderTest | Should -HaveParameter WmiEventNamespace -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WmiEventNamespace } It "Should have WmiEventQuery parameter" { - $CommandUnderTest | Should -HaveParameter WmiEventQuery -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WmiEventQuery } It "Should have NotifyMethod parameter" { - $CommandUnderTest | Should -HaveParameter NotifyMethod -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NotifyMethod } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaAgentAlertCategory.Tests.ps1 b/tests/New-DbaAgentAlertCategory.Tests.ps1 index 693950e462..33c64f5d56 100644 --- a/tests/New-DbaAgentAlertCategory.Tests.ps1 +++ b/tests/New-DbaAgentAlertCategory.Tests.ps1 @@ -9,20 +9,20 @@ Describe "New-DbaAgentAlertCategory" { BeforeAll { $CommandUnderTest = Get-Command New-DbaAgentAlertCategory } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Category as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Category -Type System.String[] -Mandatory:$false + It "Should have Category as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Category } It "Should have Force as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaAgentJob.Tests.ps1 b/tests/New-DbaAgentJob.Tests.ps1 index 6f9197bd46..a5f10f8a10 100644 --- a/tests/New-DbaAgentJob.Tests.ps1 +++ b/tests/New-DbaAgentJob.Tests.ps1 @@ -10,61 +10,61 @@ Describe "New-DbaAgentJob" { $CommandUnderTest = Get-Command New-DbaAgentJob } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Job parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Job } It "Should have Schedule parameter" { - $CommandUnderTest | Should -HaveParameter Schedule -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Schedule } It "Should have ScheduleId parameter" { - $CommandUnderTest | Should -HaveParameter ScheduleId -Type System.Int32[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ScheduleId } It "Should have Disabled parameter" { - $CommandUnderTest | Should -HaveParameter Disabled -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Disabled } It "Should have Description parameter" { - $CommandUnderTest | Should -HaveParameter Description -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Description } It "Should have StartStepId parameter" { - $CommandUnderTest | Should -HaveParameter StartStepId -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter StartStepId } It "Should have Category parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Category } It "Should have OwnerLogin parameter" { - $CommandUnderTest | Should -HaveParameter OwnerLogin -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OwnerLogin } It "Should have EventLogLevel parameter" { - $CommandUnderTest | Should -HaveParameter EventLogLevel -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EventLogLevel } It "Should have EmailLevel parameter" { - $CommandUnderTest | Should -HaveParameter EmailLevel -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EmailLevel } It "Should have PageLevel parameter" { - $CommandUnderTest | Should -HaveParameter PageLevel -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PageLevel } It "Should have EmailOperator parameter" { - $CommandUnderTest | Should -HaveParameter EmailOperator -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EmailOperator } It "Should have NetsendOperator parameter" { - $CommandUnderTest | Should -HaveParameter NetsendOperator -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NetsendOperator } It "Should have PageOperator parameter" { - $CommandUnderTest | Should -HaveParameter PageOperator -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PageOperator } It "Should have DeleteLevel parameter" { - $CommandUnderTest | Should -HaveParameter DeleteLevel -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DeleteLevel } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaAgentJobCategory.Tests.ps1 b/tests/New-DbaAgentJobCategory.Tests.ps1 index a6fe78b973..285ec59c2e 100644 --- a/tests/New-DbaAgentJobCategory.Tests.ps1 +++ b/tests/New-DbaAgentJobCategory.Tests.ps1 @@ -10,22 +10,22 @@ Describe "New-DbaAgentJobCategory" { $CommandUnderTest = Get-Command New-DbaAgentJobCategory } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Category parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type System.String[] + $CommandUnderTest | Should -HaveParameter Category } It "Should have CategoryType parameter" { - $CommandUnderTest | Should -HaveParameter CategoryType -Type System.String + $CommandUnderTest | Should -HaveParameter CategoryType } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaAgentJobStep.Tests.ps1 b/tests/New-DbaAgentJobStep.Tests.ps1 index d8270e3eda..d7ca39672e 100644 --- a/tests/New-DbaAgentJobStep.Tests.ps1 +++ b/tests/New-DbaAgentJobStep.Tests.ps1 @@ -10,73 +10,73 @@ Describe "New-DbaAgentJobStep" { $CommandUnderTest = Get-Command New-DbaAgentJobStep } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Job parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Job } It "Should have StepId parameter" { - $CommandUnderTest | Should -HaveParameter StepId -Type System.Int32 + $CommandUnderTest | Should -HaveParameter StepId } It "Should have StepName parameter" { - $CommandUnderTest | Should -HaveParameter StepName -Type System.String + $CommandUnderTest | Should -HaveParameter StepName } It "Should have Subsystem parameter" { - $CommandUnderTest | Should -HaveParameter Subsystem -Type System.String + $CommandUnderTest | Should -HaveParameter Subsystem } It "Should have SubsystemServer parameter" { - $CommandUnderTest | Should -HaveParameter SubsystemServer -Type System.String + $CommandUnderTest | Should -HaveParameter SubsystemServer } It "Should have Command parameter" { - $CommandUnderTest | Should -HaveParameter Command -Type System.String + $CommandUnderTest | Should -HaveParameter Command } It "Should have CmdExecSuccessCode parameter" { - $CommandUnderTest | Should -HaveParameter CmdExecSuccessCode -Type System.Int32 + $CommandUnderTest | Should -HaveParameter CmdExecSuccessCode } It "Should have OnSuccessAction parameter" { - $CommandUnderTest | Should -HaveParameter OnSuccessAction -Type System.String + $CommandUnderTest | Should -HaveParameter OnSuccessAction } It "Should have OnSuccessStepId parameter" { - $CommandUnderTest | Should -HaveParameter OnSuccessStepId -Type System.Int32 + $CommandUnderTest | Should -HaveParameter OnSuccessStepId } It "Should have OnFailAction parameter" { - $CommandUnderTest | Should -HaveParameter OnFailAction -Type System.String + $CommandUnderTest | Should -HaveParameter OnFailAction } It "Should have OnFailStepId parameter" { - $CommandUnderTest | Should -HaveParameter OnFailStepId -Type System.Int32 + $CommandUnderTest | Should -HaveParameter OnFailStepId } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have DatabaseUser parameter" { - $CommandUnderTest | Should -HaveParameter DatabaseUser -Type System.String + $CommandUnderTest | Should -HaveParameter DatabaseUser } It "Should have RetryAttempts parameter" { - $CommandUnderTest | Should -HaveParameter RetryAttempts -Type System.Int32 + $CommandUnderTest | Should -HaveParameter RetryAttempts } It "Should have RetryInterval parameter" { - $CommandUnderTest | Should -HaveParameter RetryInterval -Type System.Int32 + $CommandUnderTest | Should -HaveParameter RetryInterval } It "Should have OutputFileName parameter" { - $CommandUnderTest | Should -HaveParameter OutputFileName -Type System.String + $CommandUnderTest | Should -HaveParameter OutputFileName } It "Should have Insert parameter" { - $CommandUnderTest | Should -HaveParameter Insert -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Insert } It "Should have Flag parameter" { - $CommandUnderTest | Should -HaveParameter Flag -Type System.String[] + $CommandUnderTest | Should -HaveParameter Flag } It "Should have ProxyName parameter" { - $CommandUnderTest | Should -HaveParameter ProxyName -Type System.String + $CommandUnderTest | Should -HaveParameter ProxyName } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaAgentOperator.Tests.ps1 b/tests/New-DbaAgentOperator.Tests.ps1 index ec5f7b4f3e..192a3cfb70 100644 --- a/tests/New-DbaAgentOperator.Tests.ps1 +++ b/tests/New-DbaAgentOperator.Tests.ps1 @@ -6,58 +6,58 @@ Describe "New-DbaAgentOperator" { $CommandUnderTest = Get-Command New-DbaAgentOperator } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Operator parameter" { - $CommandUnderTest | Should -HaveParameter Operator -Type System.String + $CommandUnderTest | Should -HaveParameter Operator } It "Should have EmailAddress parameter" { - $CommandUnderTest | Should -HaveParameter EmailAddress -Type System.String + $CommandUnderTest | Should -HaveParameter EmailAddress } It "Should have NetSendAddress parameter" { - $CommandUnderTest | Should -HaveParameter NetSendAddress -Type System.String + $CommandUnderTest | Should -HaveParameter NetSendAddress } It "Should have PagerAddress parameter" { - $CommandUnderTest | Should -HaveParameter PagerAddress -Type System.String + $CommandUnderTest | Should -HaveParameter PagerAddress } It "Should have PagerDay parameter" { - $CommandUnderTest | Should -HaveParameter PagerDay -Type System.String + $CommandUnderTest | Should -HaveParameter PagerDay } It "Should have SaturdayStartTime parameter" { - $CommandUnderTest | Should -HaveParameter SaturdayStartTime -Type System.String + $CommandUnderTest | Should -HaveParameter SaturdayStartTime } It "Should have SaturdayEndTime parameter" { - $CommandUnderTest | Should -HaveParameter SaturdayEndTime -Type System.String + $CommandUnderTest | Should -HaveParameter SaturdayEndTime } It "Should have SundayStartTime parameter" { - $CommandUnderTest | Should -HaveParameter SundayStartTime -Type System.String + $CommandUnderTest | Should -HaveParameter SundayStartTime } It "Should have SundayEndTime parameter" { - $CommandUnderTest | Should -HaveParameter SundayEndTime -Type System.String + $CommandUnderTest | Should -HaveParameter SundayEndTime } It "Should have WeekdayStartTime parameter" { - $CommandUnderTest | Should -HaveParameter WeekdayStartTime -Type System.String + $CommandUnderTest | Should -HaveParameter WeekdayStartTime } It "Should have WeekdayEndTime parameter" { - $CommandUnderTest | Should -HaveParameter WeekdayEndTime -Type System.String + $CommandUnderTest | Should -HaveParameter WeekdayEndTime } It "Should have IsFailsafeOperator parameter" { - $CommandUnderTest | Should -HaveParameter IsFailsafeOperator -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IsFailsafeOperator } It "Should have FailsafeNotificationMethod parameter" { - $CommandUnderTest | Should -HaveParameter FailsafeNotificationMethod -Type System.String + $CommandUnderTest | Should -HaveParameter FailsafeNotificationMethod } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Server[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaAgentProxy.Tests.ps1 b/tests/New-DbaAgentProxy.Tests.ps1 index 63759994bf..2a077c5c41 100644 --- a/tests/New-DbaAgentProxy.Tests.ps1 +++ b/tests/New-DbaAgentProxy.Tests.ps1 @@ -6,40 +6,40 @@ Describe "New-DbaAgentProxy" { $CommandUnderTest = Get-Command New-DbaAgentProxy } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] + $CommandUnderTest | Should -HaveParameter Name } It "Should have ProxyCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter ProxyCredential -Type System.String[] + $CommandUnderTest | Should -HaveParameter ProxyCredential } It "Should have SubSystem as a parameter" { - $CommandUnderTest | Should -HaveParameter SubSystem -Type System.String[] + $CommandUnderTest | Should -HaveParameter SubSystem } It "Should have Description as a parameter" { - $CommandUnderTest | Should -HaveParameter Description -Type System.String + $CommandUnderTest | Should -HaveParameter Description } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String[] + $CommandUnderTest | Should -HaveParameter Login } It "Should have ServerRole as a parameter" { - $CommandUnderTest | Should -HaveParameter ServerRole -Type System.String[] + $CommandUnderTest | Should -HaveParameter ServerRole } It "Should have MsdbRole as a parameter" { - $CommandUnderTest | Should -HaveParameter MsdbRole -Type System.String[] + $CommandUnderTest | Should -HaveParameter MsdbRole } It "Should have Disabled as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Disabled -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Disabled } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaAgentSchedule.Tests.ps1 b/tests/New-DbaAgentSchedule.Tests.ps1 index 8b12de54bb..a167939f6a 100644 --- a/tests/New-DbaAgentSchedule.Tests.ps1 +++ b/tests/New-DbaAgentSchedule.Tests.ps1 @@ -10,58 +10,58 @@ Describe "New-DbaAgentSchedule Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command New-DbaAgentSchedule } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Job as a parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Job } It "Should have Schedule as a parameter" { - $CommandUnderTest | Should -HaveParameter Schedule -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Schedule } It "Should have Disabled as a parameter" { - $CommandUnderTest | Should -HaveParameter Disabled -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Disabled } It "Should have FrequencyType as a parameter" { - $CommandUnderTest | Should -HaveParameter FrequencyType -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FrequencyType } It "Should have FrequencyInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter FrequencyInterval -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FrequencyInterval } It "Should have FrequencySubdayType as a parameter" { - $CommandUnderTest | Should -HaveParameter FrequencySubdayType -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FrequencySubdayType } It "Should have FrequencySubdayInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter FrequencySubdayInterval -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FrequencySubdayInterval } It "Should have FrequencyRelativeInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter FrequencyRelativeInterval -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FrequencyRelativeInterval } It "Should have FrequencyRecurrenceFactor as a parameter" { - $CommandUnderTest | Should -HaveParameter FrequencyRecurrenceFactor -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FrequencyRecurrenceFactor } It "Should have StartDate as a parameter" { - $CommandUnderTest | Should -HaveParameter StartDate -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter StartDate } It "Should have EndDate as a parameter" { - $CommandUnderTest | Should -HaveParameter EndDate -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EndDate } It "Should have StartTime as a parameter" { - $CommandUnderTest | Should -HaveParameter StartTime -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter StartTime } It "Should have EndTime as a parameter" { - $CommandUnderTest | Should -HaveParameter EndTime -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EndTime } It "Should have Owner as a parameter" { - $CommandUnderTest | Should -HaveParameter Owner -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Owner } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/New-DbaAvailabilityGroup.Tests.ps1 b/tests/New-DbaAvailabilityGroup.Tests.ps1 index b221272942..bfdfa8971a 100644 --- a/tests/New-DbaAvailabilityGroup.Tests.ps1 +++ b/tests/New-DbaAvailabilityGroup.Tests.ps1 @@ -6,106 +6,106 @@ Describe "New-DbaAvailabilityGroup" { $CommandUnderTest = Get-Command New-DbaAvailabilityGroup } It "Should have Primary as a parameter" { - $CommandUnderTest | Should -HaveParameter Primary -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Primary } It "Should have PrimarySqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter PrimarySqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter PrimarySqlCredential } It "Should have Secondary as a parameter" { - $CommandUnderTest | Should -HaveParameter Secondary -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Secondary } It "Should have SecondarySqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SecondarySqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SecondarySqlCredential } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String + $CommandUnderTest | Should -HaveParameter Name } It "Should have IsContained as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IsContained -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IsContained } It "Should have ReuseSystemDatabases as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ReuseSystemDatabases -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ReuseSystemDatabases } It "Should have DtcSupport as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DtcSupport -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DtcSupport } It "Should have ClusterType as a parameter" { - $CommandUnderTest | Should -HaveParameter ClusterType -Type System.String + $CommandUnderTest | Should -HaveParameter ClusterType } It "Should have AutomatedBackupPreference as a parameter" { - $CommandUnderTest | Should -HaveParameter AutomatedBackupPreference -Type System.String + $CommandUnderTest | Should -HaveParameter AutomatedBackupPreference } It "Should have FailureConditionLevel as a parameter" { - $CommandUnderTest | Should -HaveParameter FailureConditionLevel -Type System.String + $CommandUnderTest | Should -HaveParameter FailureConditionLevel } It "Should have HealthCheckTimeout as a parameter" { - $CommandUnderTest | Should -HaveParameter HealthCheckTimeout -Type System.Int32 + $CommandUnderTest | Should -HaveParameter HealthCheckTimeout } It "Should have Basic as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Basic -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Basic } It "Should have DatabaseHealthTrigger as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DatabaseHealthTrigger -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DatabaseHealthTrigger } It "Should have Passthru as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Passthru } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have SharedPath as a parameter" { - $CommandUnderTest | Should -HaveParameter SharedPath -Type System.String + $CommandUnderTest | Should -HaveParameter SharedPath } It "Should have UseLastBackup as a switch parameter" { - $CommandUnderTest | Should -HaveParameter UseLastBackup -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter UseLastBackup } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have AvailabilityMode as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityMode -Type System.String + $CommandUnderTest | Should -HaveParameter AvailabilityMode } It "Should have FailoverMode as a parameter" { - $CommandUnderTest | Should -HaveParameter FailoverMode -Type System.String + $CommandUnderTest | Should -HaveParameter FailoverMode } It "Should have BackupPriority as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupPriority -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BackupPriority } It "Should have ConnectionModeInPrimaryRole as a parameter" { - $CommandUnderTest | Should -HaveParameter ConnectionModeInPrimaryRole -Type System.String + $CommandUnderTest | Should -HaveParameter ConnectionModeInPrimaryRole } It "Should have ConnectionModeInSecondaryRole as a parameter" { - $CommandUnderTest | Should -HaveParameter ConnectionModeInSecondaryRole -Type System.String + $CommandUnderTest | Should -HaveParameter ConnectionModeInSecondaryRole } It "Should have SeedingMode as a parameter" { - $CommandUnderTest | Should -HaveParameter SeedingMode -Type System.String + $CommandUnderTest | Should -HaveParameter SeedingMode } It "Should have Endpoint as a parameter" { - $CommandUnderTest | Should -HaveParameter Endpoint -Type System.String + $CommandUnderTest | Should -HaveParameter Endpoint } It "Should have EndpointUrl as a parameter" { - $CommandUnderTest | Should -HaveParameter EndpointUrl -Type System.String[] + $CommandUnderTest | Should -HaveParameter EndpointUrl } It "Should have Certificate as a parameter" { - $CommandUnderTest | Should -HaveParameter Certificate -Type System.String + $CommandUnderTest | Should -HaveParameter Certificate } It "Should have ConfigureXESession as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ConfigureXESession -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ConfigureXESession } It "Should have IPAddress as a parameter" { - $CommandUnderTest | Should -HaveParameter IPAddress -Type System.Net.IPAddress[] + $CommandUnderTest | Should -HaveParameter IPAddress } It "Should have SubnetMask as a parameter" { - $CommandUnderTest | Should -HaveParameter SubnetMask -Type System.Net.IPAddress + $CommandUnderTest | Should -HaveParameter SubnetMask } It "Should have Port as a parameter" { - $CommandUnderTest | Should -HaveParameter Port -Type System.Int32 + $CommandUnderTest | Should -HaveParameter Port } It "Should have Dhcp as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Dhcp -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Dhcp } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaAzAccessToken.Tests.ps1 b/tests/New-DbaAzAccessToken.Tests.ps1 index 7f8e2a3018..9eb542a209 100644 --- a/tests/New-DbaAzAccessToken.Tests.ps1 +++ b/tests/New-DbaAzAccessToken.Tests.ps1 @@ -9,29 +9,29 @@ Describe "New-DbaAzAccessToken" { BeforeAll { $CommandUnderTest = Get-Command New-DbaAzAccessToken } - It "Should have Type as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String -Mandatory:$false + It "Should have Type as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Type } - It "Should have Subtype as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Subtype -Type System.String -Mandatory:$false + It "Should have Subtype as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Subtype } - It "Should have Config as a non-mandatory Object parameter" { - $CommandUnderTest | Should -HaveParameter Config -Type System.Object -Mandatory:$false + It "Should have Config as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Config } - It "Should have Credential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } - It "Should have Tenant as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Tenant -Type System.String -Mandatory:$false + It "Should have Tenant as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Tenant } - It "Should have Thumbprint as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Thumbprint -Type System.String -Mandatory:$false + It "Should have Thumbprint as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Thumbprint } - It "Should have Store as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Store -Type System.String -Mandatory:$false + It "Should have Store as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Store } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/New-DbaClientAlias.Tests.ps1 b/tests/New-DbaClientAlias.Tests.ps1 index f88ae6a6a2..0d108bd4b1 100644 --- a/tests/New-DbaClientAlias.Tests.ps1 +++ b/tests/New-DbaClientAlias.Tests.ps1 @@ -12,28 +12,28 @@ Describe "New-DbaClientAlias" { $CommandUnderTest = Get-Command New-DbaClientAlias } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have ServerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ServerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter ServerName } It "Should have Alias as a parameter" { - $CommandUnderTest | Should -HaveParameter Alias -Type System.String + $CommandUnderTest | Should -HaveParameter Alias } It "Should have Protocol as a parameter" { - $CommandUnderTest | Should -HaveParameter Protocol -Type System.String + $CommandUnderTest | Should -HaveParameter Protocol } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } Context "Functionality" -Tag "IntegrationTests" { It "adds the alias" { - $results = New-DbaClientAlias -ServerName sql2016 -Alias dbatoolscialias-new -Verbose:$false + $results = New-DbaClientAlias -ServerName sql2016 -Alias dbatoolscialias-new $results.AliasName | Should -Be @('dbatoolscialias-new', 'dbatoolscialias-new') $results | Remove-DbaClientAlias } diff --git a/tests/New-DbaCmConnection.Tests.ps1 b/tests/New-DbaCmConnection.Tests.ps1 index 98c2c7054c..3f5bc3f7de 100644 --- a/tests/New-DbaCmConnection.Tests.ps1 +++ b/tests/New-DbaCmConnection.Tests.ps1 @@ -6,43 +6,43 @@ Describe "New-DbaCmConnection" { $CommandUnderTest = Get-Command New-DbaCmConnection } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaCmConnectionParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have UseWindowsCredentials as a switch parameter" { - $CommandUnderTest | Should -HaveParameter UseWindowsCredentials -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter UseWindowsCredentials } It "Should have OverrideExplicitCredential as a switch parameter" { - $CommandUnderTest | Should -HaveParameter OverrideExplicitCredential -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter OverrideExplicitCredential } It "Should have DisabledConnectionTypes as a parameter" { - $CommandUnderTest | Should -HaveParameter DisabledConnectionTypes -Type Dataplat.Dbatools.Connection.ManagementConnectionType + $CommandUnderTest | Should -HaveParameter DisabledConnectionTypes } It "Should have DisableBadCredentialCache as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DisableBadCredentialCache -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DisableBadCredentialCache } It "Should have DisableCimPersistence as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DisableCimPersistence -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DisableCimPersistence } It "Should have DisableCredentialAutoRegister as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DisableCredentialAutoRegister -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DisableCredentialAutoRegister } It "Should have EnableCredentialFailover as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableCredentialFailover -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableCredentialFailover } It "Should have WindowsCredentialsAreBad as a switch parameter" { - $CommandUnderTest | Should -HaveParameter WindowsCredentialsAreBad -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter WindowsCredentialsAreBad } It "Should have CimWinRMOptions as a parameter" { - $CommandUnderTest | Should -HaveParameter CimWinRMOptions -Type Microsoft.Management.Infrastructure.Options.WSManSessionOptions + $CommandUnderTest | Should -HaveParameter CimWinRMOptions } It "Should have CimDCOMOptions as a parameter" { - $CommandUnderTest | Should -HaveParameter CimDCOMOptions -Type Microsoft.Management.Infrastructure.Options.DComSessionOptions + $CommandUnderTest | Should -HaveParameter CimDCOMOptions } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/New-DbaComputerCertificate.Tests.ps1 b/tests/New-DbaComputerCertificate.Tests.ps1 index aa424ce064..ff59761e21 100644 --- a/tests/New-DbaComputerCertificate.Tests.ps1 +++ b/tests/New-DbaComputerCertificate.Tests.ps1 @@ -6,55 +6,55 @@ Describe "New-DbaComputerCertificate" { $CommandUnderTest = Get-Command New-DbaComputerCertificate } It "Should have ComputerName as a non-mandatory DbaInstanceParameter[] parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have CaServer as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter CaServer -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CaServer } It "Should have CaName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter CaName -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CaName } It "Should have ClusterInstanceName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ClusterInstanceName -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ClusterInstanceName } It "Should have SecurePassword as a non-mandatory SecureString parameter" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type System.Security.SecureString -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SecurePassword } It "Should have FriendlyName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter FriendlyName -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FriendlyName } It "Should have CertificateTemplate as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter CertificateTemplate -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CertificateTemplate } It "Should have KeyLength as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter KeyLength -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter KeyLength } It "Should have Store as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Store -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Store } It "Should have Folder as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Folder -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Folder } It "Should have Flag as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Flag -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Flag } It "Should have Dns as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Dns -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Dns } It "Should have SelfSigned as a non-mandatory Switch parameter" { - $CommandUnderTest | Should -HaveParameter SelfSigned -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SelfSigned } It "Should have EnableException as a non-mandatory Switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have HashAlgorithm as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter HashAlgorithm -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter HashAlgorithm } It "Should have MonthsValid as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter MonthsValid -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MonthsValid } } } diff --git a/tests/New-DbaComputerCertificateSigningRequest.Tests.ps1 b/tests/New-DbaComputerCertificateSigningRequest.Tests.ps1 index c56836513e..9c92b0e236 100644 --- a/tests/New-DbaComputerCertificateSigningRequest.Tests.ps1 +++ b/tests/New-DbaComputerCertificateSigningRequest.Tests.ps1 @@ -5,29 +5,29 @@ Describe "New-DbaComputerCertificateSigningRequest" { BeforeAll { $CommandUnderTest = Get-Command New-DbaComputerCertificateSigningRequest } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } - It "Should have ClusterInstanceName as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter ClusterInstanceName -Type System.String -Mandatory:$false + It "Should have ClusterInstanceName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ClusterInstanceName } - It "Should have Path as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } - It "Should have FriendlyName as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter FriendlyName -Type System.String -Mandatory:$false + It "Should have FriendlyName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter FriendlyName } - It "Should have KeyLength as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter KeyLength -Type System.Int32 -Mandatory:$false + It "Should have KeyLength as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter KeyLength } - It "Should have Dns as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Dns -Type System.String[] -Mandatory:$false + It "Should have Dns as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Dns } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaConnectionString.Tests.ps1 b/tests/New-DbaConnectionString.Tests.ps1 index c75b415efd..56c38533cf 100644 --- a/tests/New-DbaConnectionString.Tests.ps1 +++ b/tests/New-DbaConnectionString.Tests.ps1 @@ -5,83 +5,83 @@ Describe "New-DbaConnectionString" { BeforeAll { $CommandUnderTest = Get-Command New-DbaConnectionString } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance -Mandatory:$false } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential -Mandatory:$false } - It "Should have AccessToken as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter AccessToken -Type System.String -Mandatory:$false + It "Should have AccessToken as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter AccessToken -Mandatory:$false } - It "Should have ApplicationIntent as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter ApplicationIntent -Type System.String -Mandatory:$false + It "Should have ApplicationIntent as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ApplicationIntent -Mandatory:$false } - It "Should have BatchSeparator as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter BatchSeparator -Type System.String -Mandatory:$false + It "Should have BatchSeparator as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter BatchSeparator -Mandatory:$false } - It "Should have ClientName as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter ClientName -Type System.String -Mandatory:$false + It "Should have ClientName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ClientName -Mandatory:$false } - It "Should have ConnectTimeout as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter ConnectTimeout -Type System.Int32 -Mandatory:$false + It "Should have ConnectTimeout as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ConnectTimeout -Mandatory:$false } - It "Should have Database as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database -Mandatory:$false } It "Should have EncryptConnection as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EncryptConnection -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EncryptConnection -Mandatory:$false } - It "Should have FailoverPartner as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter FailoverPartner -Type System.String -Mandatory:$false + It "Should have FailoverPartner as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter FailoverPartner -Mandatory:$false } It "Should have IsActiveDirectoryUniversalAuth as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IsActiveDirectoryUniversalAuth -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IsActiveDirectoryUniversalAuth -Mandatory:$false } - It "Should have LockTimeout as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter LockTimeout -Type System.Int32 -Mandatory:$false + It "Should have LockTimeout as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter LockTimeout -Mandatory:$false } - It "Should have MaxPoolSize as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter MaxPoolSize -Type System.Int32 -Mandatory:$false + It "Should have MaxPoolSize as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter MaxPoolSize -Mandatory:$false } - It "Should have MinPoolSize as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter MinPoolSize -Type System.Int32 -Mandatory:$false + It "Should have MinPoolSize as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter MinPoolSize -Mandatory:$false } It "Should have MultipleActiveResultSets as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter MultipleActiveResultSets -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MultipleActiveResultSets -Mandatory:$false } It "Should have MultiSubnetFailover as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter MultiSubnetFailover -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MultiSubnetFailover -Mandatory:$false } - It "Should have NetworkProtocol as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter NetworkProtocol -Type System.String -Mandatory:$false + It "Should have NetworkProtocol as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter NetworkProtocol -Mandatory:$false } It "Should have NonPooledConnection as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter NonPooledConnection -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NonPooledConnection -Mandatory:$false } - It "Should have PacketSize as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter PacketSize -Type System.Int32 -Mandatory:$false + It "Should have PacketSize as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter PacketSize -Mandatory:$false } - It "Should have PooledConnectionLifetime as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter PooledConnectionLifetime -Type System.Int32 -Mandatory:$false + It "Should have PooledConnectionLifetime as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter PooledConnectionLifetime -Mandatory:$false } - It "Should have SqlExecutionModes as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter SqlExecutionModes -Type System.String -Mandatory:$false + It "Should have SqlExecutionModes as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlExecutionModes -Mandatory:$false } - It "Should have StatementTimeout as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter StatementTimeout -Type System.Int32 -Mandatory:$false + It "Should have StatementTimeout as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter StatementTimeout -Mandatory:$false } It "Should have TrustServerCertificate as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter TrustServerCertificate -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter TrustServerCertificate -Mandatory:$false } - It "Should have WorkstationId as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter WorkstationId -Type System.String -Mandatory:$false + It "Should have WorkstationId as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter WorkstationId -Mandatory:$false } It "Should have Legacy as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Legacy -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Legacy -Mandatory:$false } - It "Should have AppendConnectionString as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter AppendConnectionString -Type System.String -Mandatory:$false + It "Should have AppendConnectionString as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter AppendConnectionString -Mandatory:$false } } diff --git a/tests/New-DbaConnectionStringBuilder.Tests.ps1 b/tests/New-DbaConnectionStringBuilder.Tests.ps1 index 798ec6daba..d3ab7253c8 100644 --- a/tests/New-DbaConnectionStringBuilder.Tests.ps1 +++ b/tests/New-DbaConnectionStringBuilder.Tests.ps1 @@ -6,43 +6,43 @@ Describe "New-DbaConnectionStringBuilder" { $CommandUnderTest = Get-Command New-DbaConnectionStringBuilder } It "Should have ConnectionString as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter ConnectionString -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ConnectionString } It "Should have ApplicationName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ApplicationName -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ApplicationName } It "Should have DataSource as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter DataSource -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DataSource } It "Should have SqlCredential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have InitialCatalog as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter InitialCatalog -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InitialCatalog } It "Should have IntegratedSecurity as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter IntegratedSecurity -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IntegratedSecurity } It "Should have UserName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter UserName -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter UserName } It "Should have Password as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Password -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Password } It "Should have MultipleActiveResultSets as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter MultipleActiveResultSets -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MultipleActiveResultSets } It "Should have ColumnEncryptionSetting as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ColumnEncryptionSetting -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ColumnEncryptionSetting } It "Should have Legacy as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Legacy -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Legacy } It "Should have NonPooledConnection as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter NonPooledConnection -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NonPooledConnection } It "Should have WorkstationId as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter WorkstationId -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WorkstationId } } diff --git a/tests/New-DbaCredential.Tests.ps1 b/tests/New-DbaCredential.Tests.ps1 index 1d75185dd8..925f210ba4 100644 --- a/tests/New-DbaCredential.Tests.ps1 +++ b/tests/New-DbaCredential.Tests.ps1 @@ -14,31 +14,31 @@ Describe 'New-DbaCredential' -Tag 'UnitTests', 'IntegrationTests' { $CommandUnderTest = Get-Command -Name $CommandName } It "Accepts SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter -Name 'SqlInstance' -Type 'DbaInstanceParameter[]' -Mandatory:$false + $CommandUnderTest | Should -HaveParameter -Name 'SqlInstance' } It "Accepts SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter -Name 'SqlCredential' -Type 'PSCredential' -Mandatory:$false + $CommandUnderTest | Should -HaveParameter -Name 'SqlCredential' } It "Accepts Name as a parameter" { - $CommandUnderTest | Should -HaveParameter -Name 'Name' -Type 'System.String' -Mandatory:$false + $CommandUnderTest | Should -HaveParameter -Name 'Name' } It "Accepts Identity as a parameter" { - $CommandUnderTest | Should -HaveParameter -Name 'Identity' -Type 'System.String' -Mandatory:$false + $CommandUnderTest | Should -HaveParameter -Name 'Identity' } It "Accepts SecurePassword as a parameter" { - $CommandUnderTest | Should -HaveParameter -Name 'SecurePassword' -Type 'System.Security.SecureString' -Mandatory:$false + $CommandUnderTest | Should -HaveParameter -Name 'SecurePassword' } It "Accepts MappedClassType as a parameter" { - $CommandUnderTest | Should -HaveParameter -Name 'MappedClassType' -Type 'System.String' -Mandatory:$false + $CommandUnderTest | Should -HaveParameter -Name 'MappedClassType' } It "Accepts ProviderName as a parameter" { - $CommandUnderTest | Should -HaveParameter -Name 'ProviderName' -Type 'System.String' -Mandatory:$false + $CommandUnderTest | Should -HaveParameter -Name 'ProviderName' } It "Accepts Force as a parameter" { - $CommandUnderTest | Should -HaveParameter -Name 'Force' -Type 'System.Management.Automation.SwitchParameter' -Mandatory:$false + $CommandUnderTest | Should -HaveParameter -Name 'Force' } It "Accepts EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter -Name 'EnableException' -Type 'System.Management.Automation.SwitchParameter' -Mandatory:$false + $CommandUnderTest | Should -HaveParameter -Name 'EnableException' } } diff --git a/tests/New-DbaCustomError.Tests.ps1 b/tests/New-DbaCustomError.Tests.ps1 index bf10cc44f1..f2641e1420 100644 --- a/tests/New-DbaCustomError.Tests.ps1 +++ b/tests/New-DbaCustomError.Tests.ps1 @@ -10,28 +10,28 @@ Describe "New-DbaCustomError" { $CommandUnderTest = Get-Command New-DbaCustomError } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have MessageID as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter MessageID -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MessageID } It "Should have Severity as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter Severity -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Severity } It "Should have MessageText as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter MessageText -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MessageText } It "Should have Language as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Language -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Language } It "Should have WithLog as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter WithLog -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WithLog } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaDacOption.Tests.ps1 b/tests/New-DbaDacOption.Tests.ps1 index 8593440ad4..758392cdd7 100644 --- a/tests/New-DbaDacOption.Tests.ps1 +++ b/tests/New-DbaDacOption.Tests.ps1 @@ -5,20 +5,20 @@ Describe "New-DbaDacOption" { BeforeAll { $CommandUnderTest = Get-Command New-DbaDacOption } - It "Should have Type as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String -Mandatory:$false + It "Should have Type as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Type } - It "Should have Action as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Action -Type System.String -Mandatory:$false + It "Should have Action as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Action } - It "Should have PublishXml as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter PublishXml -Type System.String -Mandatory:$false + It "Should have PublishXml as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter PublishXml } - It "Should have Property as a non-mandatory System.Collections.Hashtable parameter" { - $CommandUnderTest | Should -HaveParameter Property -Type System.Collections.Hashtable -Mandatory:$false + It "Should have Property as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Property -Type System.Collections.Hashtable } - It "Should have EnableException as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have EnableException as a non-mandatory SwitchParameter" { + $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter } } diff --git a/tests/New-DbaDacProfile.Tests.ps1 b/tests/New-DbaDacProfile.Tests.ps1 index cb933c41b1..024d86d433 100644 --- a/tests/New-DbaDacProfile.Tests.ps1 +++ b/tests/New-DbaDacProfile.Tests.ps1 @@ -6,25 +6,25 @@ Describe "New-DbaDacProfile" { $CommandUnderTest = Get-Command New-DbaDacProfile } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have ConnectionString as a parameter" { - $CommandUnderTest | Should -HaveParameter ConnectionString -Type System.String[] + $CommandUnderTest | Should -HaveParameter ConnectionString } It "Should have PublishOptions as a parameter" { - $CommandUnderTest | Should -HaveParameter PublishOptions -Type Hashtable + $CommandUnderTest | Should -HaveParameter PublishOptions } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaDatabase.Tests.ps1 b/tests/New-DbaDatabase.Tests.ps1 index 74483ae338..350dee6050 100644 --- a/tests/New-DbaDatabase.Tests.ps1 +++ b/tests/New-DbaDatabase.Tests.ps1 @@ -35,73 +35,73 @@ Describe "New-DbaDatabase" { $CommandUnderTest = Get-Command New-DbaDatabase } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Name parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Name } It "Should have Collation parameter" { - $CommandUnderTest | Should -HaveParameter Collation -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Collation } It "Should have RecoveryModel parameter" { - $CommandUnderTest | Should -HaveParameter RecoveryModel -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter RecoveryModel } It "Should have Owner parameter" { - $CommandUnderTest | Should -HaveParameter Owner -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Owner } It "Should have DataFilePath parameter" { - $CommandUnderTest | Should -HaveParameter DataFilePath -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DataFilePath } It "Should have LogFilePath parameter" { - $CommandUnderTest | Should -HaveParameter LogFilePath -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LogFilePath } It "Should have PrimaryFilesize parameter" { - $CommandUnderTest | Should -HaveParameter PrimaryFilesize -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PrimaryFilesize } It "Should have PrimaryFileGrowth parameter" { - $CommandUnderTest | Should -HaveParameter PrimaryFileGrowth -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PrimaryFileGrowth } It "Should have PrimaryFileMaxSize parameter" { - $CommandUnderTest | Should -HaveParameter PrimaryFileMaxSize -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PrimaryFileMaxSize } It "Should have LogSize parameter" { - $CommandUnderTest | Should -HaveParameter LogSize -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LogSize } It "Should have LogGrowth parameter" { - $CommandUnderTest | Should -HaveParameter LogGrowth -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LogGrowth } It "Should have LogMaxSize parameter" { - $CommandUnderTest | Should -HaveParameter LogMaxSize -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LogMaxSize } It "Should have SecondaryFilesize parameter" { - $CommandUnderTest | Should -HaveParameter SecondaryFilesize -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SecondaryFilesize } It "Should have SecondaryFileGrowth parameter" { - $CommandUnderTest | Should -HaveParameter SecondaryFileGrowth -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SecondaryFileGrowth } It "Should have SecondaryFileMaxSize parameter" { - $CommandUnderTest | Should -HaveParameter SecondaryFileMaxSize -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SecondaryFileMaxSize } It "Should have SecondaryFileCount parameter" { - $CommandUnderTest | Should -HaveParameter SecondaryFileCount -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SecondaryFileCount } It "Should have DefaultFileGroup parameter" { - $CommandUnderTest | Should -HaveParameter DefaultFileGroup -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DefaultFileGroup } It "Should have DataFileSuffix parameter" { - $CommandUnderTest | Should -HaveParameter DataFileSuffix -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DataFileSuffix } It "Should have LogFileSuffix parameter" { - $CommandUnderTest | Should -HaveParameter LogFileSuffix -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LogFileSuffix } It "Should have SecondaryDataFileSuffix parameter" { - $CommandUnderTest | Should -HaveParameter SecondaryDataFileSuffix -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SecondaryDataFileSuffix } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaDbAsymmetricKey.Tests.ps1 b/tests/New-DbaDbAsymmetricKey.Tests.ps1 index a1747ef72d..91a0d0a2eb 100644 --- a/tests/New-DbaDbAsymmetricKey.Tests.ps1 +++ b/tests/New-DbaDbAsymmetricKey.Tests.ps1 @@ -10,37 +10,37 @@ Describe "New-DbaDbAsymmetricKey" { $CommandUnderTest = Get-Command New-DbaDbAsymmetricKey } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] + $CommandUnderTest | Should -HaveParameter Name } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have SecurePassword as a parameter" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter SecurePassword } It "Should have Owner as a parameter" { - $CommandUnderTest | Should -HaveParameter Owner -Type System.String + $CommandUnderTest | Should -HaveParameter Owner } It "Should have KeySource as a parameter" { - $CommandUnderTest | Should -HaveParameter KeySource -Type System.String + $CommandUnderTest | Should -HaveParameter KeySource } It "Should have KeySourceType as a parameter" { - $CommandUnderTest | Should -HaveParameter KeySourceType -Type System.String + $CommandUnderTest | Should -HaveParameter KeySourceType } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Algorithm as a parameter" { - $CommandUnderTest | Should -HaveParameter Algorithm -Type System.String + $CommandUnderTest | Should -HaveParameter Algorithm } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -48,12 +48,12 @@ Describe "New-DbaDbAsymmetricKey" { BeforeAll { $tPassword = ConvertTo-SecureString "ThisIsThePassword1" -AsPlainText -Force if (!(Get-DbaDbMasterKey -SqlInstance $global:instance2 -Database master)) { - New-DbaDbMasterKey -SqlInstance $global:instance2 -Database master -SecurePassword $tPassword -Confirm:$false + New-DbaDbMasterKey -SqlInstance $global:instance2 -Database master -SecurePassword $tPassword } } AfterAll { - Remove-DbaDatabase -SqlInstance $global:instance2 -Database enctest -Confirm:$false + Remove-DbaDatabase -SqlInstance $global:instance2 -Database enctest } It "Should create new key in master" { @@ -68,7 +68,7 @@ Describe "New-DbaDbAsymmetricKey" { It "Should warn when key already exists" { $keyname = 'test1' $null = New-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Name $keyname -Database master -WarningVariable warnvar 3> $null - $null = Remove-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Name $keyname -Database master -Confirm:$false + $null = Remove-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Name $keyname -Database master $warnvar | Should -BeLike '*already exists in master on*' } @@ -80,7 +80,7 @@ Describe "New-DbaDbAsymmetricKey" { $results.database | Should -Be 'master' $results.name | Should -Be $keyname $results.KeyLength | Should -Be 4096 - $null = Remove-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Name $keyname -Database master -Confirm:$false + $null = Remove-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Name $keyname -Database master } It "Should create key in non-master database" { @@ -90,7 +90,7 @@ Describe "New-DbaDbAsymmetricKey" { $database = 'enctest' New-DbaDatabase -SqlInstance $global:instance2 -Name $database $tPassword = ConvertTo-SecureString "ThisIsThePassword1" -AsPlainText -Force - New-DbaDbMasterKey -SqlInstance $global:instance2 -Database $database -SecurePassword $tPassword -Confirm:$false + New-DbaDbMasterKey -SqlInstance $global:instance2 -Database $database -SecurePassword $tPassword New-DbaDbUser -SqlInstance $global:instance2 -Database $database -UserName $dbuser $key = New-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Database $database -Name $keyname -Owner $dbuser -Algorithm $algorithm $results = Get-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Name $keyname -Database $database @@ -98,7 +98,7 @@ Describe "New-DbaDbAsymmetricKey" { $results.name | Should -Be $keyname $results.KeyLength | Should -Be 4096 $results.Owner | Should -Be $dbuser - $null = Remove-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Name $keyname -Database $database -Confirm:$false + $null = Remove-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Name $keyname -Database $database } It "Should set owner correctly" { @@ -112,7 +112,7 @@ Describe "New-DbaDbAsymmetricKey" { $results.name | Should -Be $keyname $results.KeyLength | Should -Be 4096 $results.Owner | Should -Be $dbuser - $null = Remove-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Name $keyname -Database $database -Confirm:$false + $null = Remove-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Name $keyname -Database $database } It "Should create new key loaded from a keyfile" -Skip:(-not (Test-Path -Path "$($env:appveyorlabrepo)\keytests\keypair.snk")) { @@ -125,7 +125,7 @@ Describe "New-DbaDbAsymmetricKey" { $results.database | Should -Be $database $results.name | Should -Be $keyname $results.Owner | Should -Be $dbuser - $null = Remove-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Name $keyname -Database $database -Confirm:$false + $null = Remove-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Name $keyname -Database $database } It "Should fail key creation from a missing keyfile" { @@ -137,7 +137,7 @@ Describe "New-DbaDbAsymmetricKey" { $results = Get-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Name $keyname -Database $database $warnvar | Should -Not -BeNullOrEmpty $results | Should -BeNullOrEmpty - $null = Remove-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Name $keyname -Database $database -Confirm:$false + $null = Remove-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Name $keyname -Database $database } } } diff --git a/tests/New-DbaDbCertificate.Tests.ps1 b/tests/New-DbaDbCertificate.Tests.ps1 index cc4a895236..31f49d5b05 100644 --- a/tests/New-DbaDbCertificate.Tests.ps1 +++ b/tests/New-DbaDbCertificate.Tests.ps1 @@ -12,37 +12,37 @@ Describe "New-DbaDbCertificate" { $CommandUnderTest = Get-Command New-DbaDbCertificate } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] + $CommandUnderTest | Should -HaveParameter Name } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Subject as a parameter" { - $CommandUnderTest | Should -HaveParameter Subject -Type System.String[] + $CommandUnderTest | Should -HaveParameter Subject } It "Should have StartDate as a parameter" { - $CommandUnderTest | Should -HaveParameter StartDate -Type System.DateTime + $CommandUnderTest | Should -HaveParameter StartDate } It "Should have ExpirationDate as a parameter" { - $CommandUnderTest | Should -HaveParameter ExpirationDate -Type System.DateTime + $CommandUnderTest | Should -HaveParameter ExpirationDate } It "Should have ActiveForServiceBrokerDialog as a parameter" { - $CommandUnderTest | Should -HaveParameter ActiveForServiceBrokerDialog -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ActiveForServiceBrokerDialog } It "Should have SecurePassword as a parameter" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter SecurePassword } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -51,29 +51,29 @@ Describe "New-DbaDbCertificate" { $global:instance1 = $global:instance1 # Assuming this is defined in constants.ps1 if (-not (Get-DbaDbMasterKey -SqlInstance $global:instance1 -Database master)) { - $masterkey = New-DbaDbMasterKey -SqlInstance $global:instance1 -Database master -Password $(ConvertTo-SecureString -String "GoodPass1234!" -AsPlainText -Force) -Confirm:$false + $masterkey = New-DbaDbMasterKey -SqlInstance $global:instance1 -Database master -Password $(ConvertTo-SecureString -String "GoodPass1234!" -AsPlainText -Force) } - $tempdbmasterkey = New-DbaDbMasterKey -SqlInstance $global:instance1 -Database tempdb -Password $(ConvertTo-SecureString -String "GoodPass1234!" -AsPlainText -Force) -Confirm:$false + $tempdbmasterkey = New-DbaDbMasterKey -SqlInstance $global:instance1 -Database tempdb -Password $(ConvertTo-SecureString -String "GoodPass1234!" -AsPlainText -Force) $certificateName1 = "Cert_$(Get-random)" $certificateName2 = "Cert_$(Get-random)" } AfterAll { - if ($tempdbmasterkey) { $tempdbmasterkey | Remove-DbaDbMasterKey -Confirm:$false } - if ($masterKey) { $masterkey | Remove-DbaDbMasterKey -Confirm:$false } + if ($tempdbmasterkey) { $tempdbmasterkey | Remove-DbaDbMasterKey } + if ($masterKey) { $masterkey | Remove-DbaDbMasterKey } } It "Successfully creates a new database certificate in default, master database" { - $cert1 = New-DbaDbCertificate -SqlInstance $global:instance1 -Name $certificateName1 -Confirm:$false + $cert1 = New-DbaDbCertificate -SqlInstance $global:instance1 -Name $certificateName1 $cert1.Name | Should -Match $certificateName1 - $cert1 | Remove-DbaDbCertificate -Confirm:$false + $cert1 | Remove-DbaDbCertificate } It "Successfully creates a new database certificate in the tempdb database" { - $cert2 = New-DbaDbCertificate -SqlInstance $global:instance1 -Name $certificateName2 -Database tempdb -Confirm:$false + $cert2 = New-DbaDbCertificate -SqlInstance $global:instance1 -Name $certificateName2 -Database tempdb $cert2.Database | Should -Match "tempdb" - $cert2 | Remove-DbaDbCertificate -Confirm:$false + $cert2 | Remove-DbaDbCertificate } } } diff --git a/tests/New-DbaDbDataGeneratorConfig.Tests.ps1 b/tests/New-DbaDbDataGeneratorConfig.Tests.ps1 index 76d71ed03e..2f1263d99a 100644 --- a/tests/New-DbaDbDataGeneratorConfig.Tests.ps1 +++ b/tests/New-DbaDbDataGeneratorConfig.Tests.ps1 @@ -25,35 +25,35 @@ Describe "New-DbaDbDataGeneratorConfig" { BeforeAll { $CommandUnderTest = Get-Command New-DbaDbDataGeneratorConfig } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have Table as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] -Mandatory:$false + It "Should have Table as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Table } It "Should have ResetIdentity as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ResetIdentity -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ResetIdentity } It "Should have TruncateTable as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter TruncateTable -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter TruncateTable } - It "Should have Rows as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter Rows -Type System.Int32 -Mandatory:$false + It "Should have Rows as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Rows } - It "Should have Path as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } It "Should have Force as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaDbEncryptionKey.Tests.ps1 b/tests/New-DbaDbEncryptionKey.Tests.ps1 index 5b159b213a..a07123faa8 100644 --- a/tests/New-DbaDbEncryptionKey.Tests.ps1 +++ b/tests/New-DbaDbEncryptionKey.Tests.ps1 @@ -6,31 +6,31 @@ Describe "New-DbaDbEncryptionKey Unit Tests" -Tag "UnitTests" { $CommandUnderTest = Get-Command New-DbaDbEncryptionKey } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have EncryptorName parameter" { - $CommandUnderTest | Should -HaveParameter EncryptorName -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EncryptorName } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type } It "Should have EncryptionAlgorithm parameter" { - $CommandUnderTest | Should -HaveParameter EncryptionAlgorithm -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EncryptionAlgorithm } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/New-DbaDbFileGroup.Tests.ps1 b/tests/New-DbaDbFileGroup.Tests.ps1 index 6804813db6..3eb873be56 100644 --- a/tests/New-DbaDbFileGroup.Tests.ps1 +++ b/tests/New-DbaDbFileGroup.Tests.ps1 @@ -37,25 +37,25 @@ Describe "New-DbaDbFileGroup" { $CommandUnderTest = Get-Command New-DbaDbFileGroup } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.SqlServer.Management.Smo.Credential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have FileGroup parameter" { - $CommandUnderTest | Should -HaveParameter FileGroup -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FileGroup } It "Should have FileGroupType parameter" { - $CommandUnderTest | Should -HaveParameter FileGroupType -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FileGroupType } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaDbMailAccount.Tests.ps1 b/tests/New-DbaDbMailAccount.Tests.ps1 index c2c6274085..f41e200c93 100644 --- a/tests/New-DbaDbMailAccount.Tests.ps1 +++ b/tests/New-DbaDbMailAccount.Tests.ps1 @@ -5,35 +5,35 @@ Describe "New-DbaDbMailAccount" { BeforeAll { $CommandUnderTest = Get-Command New-DbaDbMailAccount } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type Microsoft.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Account as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Account -Type System.String -Mandatory:$false + It "Should have Account as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Account } - It "Should have DisplayName as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter DisplayName -Type System.String -Mandatory:$false + It "Should have DisplayName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter DisplayName } - It "Should have Description as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Description -Type System.String -Mandatory:$false + It "Should have Description as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Description } - It "Should have EmailAddress as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter EmailAddress -Type System.String -Mandatory:$false + It "Should have EmailAddress as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter EmailAddress } - It "Should have ReplyToAddress as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter ReplyToAddress -Type System.String -Mandatory:$false + It "Should have ReplyToAddress as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ReplyToAddress } - It "Should have MailServer as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter MailServer -Type System.String -Mandatory:$false + It "Should have MailServer as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter MailServer } It "Should have Force as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaDbMailProfile.Tests.ps1 b/tests/New-DbaDbMailProfile.Tests.ps1 index 8aea808b3b..2a598b520e 100644 --- a/tests/New-DbaDbMailProfile.Tests.ps1 +++ b/tests/New-DbaDbMailProfile.Tests.ps1 @@ -5,26 +5,26 @@ Describe "New-DbaDbMailProfile" { BeforeAll { $CommandUnderTest = Get-Command New-DbaDbMailProfile } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance -Mandatory:$false } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential -Mandatory:$false } - It "Should have Profile as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Profile -Type System.String -Mandatory:$false + It "Should have Profile as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Profile -Mandatory:$false } - It "Should have Description as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Description -Type System.String -Mandatory:$false + It "Should have Description as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Description -Mandatory:$false } - It "Should have MailAccountName as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter MailAccountName -Type System.String -Mandatory:$false + It "Should have MailAccountName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter MailAccountName -Mandatory:$false } - It "Should have MailAccountPriority as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter MailAccountPriority -Type System.Int32 -Mandatory:$false + It "Should have MailAccountPriority as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter MailAccountPriority -Mandatory:$false } - It "Should have EnableException as a non-mandatory parameter of type Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have EnableException as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter EnableException -Mandatory:$false } } diff --git a/tests/New-DbaDbMaskingConfig.Tests.ps1 b/tests/New-DbaDbMaskingConfig.Tests.ps1 index 719e806a93..b5e8f60492 100644 --- a/tests/New-DbaDbMaskingConfig.Tests.ps1 +++ b/tests/New-DbaDbMaskingConfig.Tests.ps1 @@ -5,53 +5,53 @@ Describe "New-DbaDbMaskingConfig" { BeforeAll { $CommandUnderTest = Get-Command New-DbaDbMaskingConfig } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have Table as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] -Mandatory:$false + It "Should have Table as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Table } - It "Should have Column as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Column -Type System.String[] -Mandatory:$false + It "Should have Column as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Column } - It "Should have Path as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } - It "Should have Locale as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Locale -Type System.String -Mandatory:$false + It "Should have Locale as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Locale } - It "Should have CharacterString as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter CharacterString -Type System.String -Mandatory:$false + It "Should have CharacterString as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter CharacterString } - It "Should have SampleCount as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter SampleCount -Type System.Int32 -Mandatory:$false + It "Should have SampleCount as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SampleCount } - It "Should have KnownNameFilePath as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter KnownNameFilePath -Type System.String -Mandatory:$false + It "Should have KnownNameFilePath as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter KnownNameFilePath } - It "Should have PatternFilePath as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter PatternFilePath -Type System.String -Mandatory:$false + It "Should have PatternFilePath as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter PatternFilePath } It "Should have ExcludeDefaultKnownName as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDefaultKnownName -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDefaultKnownName } It "Should have ExcludeDefaultPattern as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDefaultPattern -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDefaultPattern } It "Should have Force as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } - It "Should have InputObject as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaDbMasterKey.Tests.ps1 b/tests/New-DbaDbMasterKey.Tests.ps1 index 6b85ce5cd9..110b7f63f4 100644 --- a/tests/New-DbaDbMasterKey.Tests.ps1 +++ b/tests/New-DbaDbMasterKey.Tests.ps1 @@ -6,25 +6,25 @@ Describe "New-DbaDbMasterKey" { $CommandUnderTest = Get-Command New-DbaDbMasterKey } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have SecurePassword as a parameter" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter SecurePassword } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaDbRole.Tests.ps1 b/tests/New-DbaDbRole.Tests.ps1 index 44f26bf7fb..76cc485ce8 100644 --- a/tests/New-DbaDbRole.Tests.ps1 +++ b/tests/New-DbaDbRole.Tests.ps1 @@ -23,28 +23,28 @@ Describe "New-DbaDbRole" { $CommandUnderTest = Get-Command New-DbaDbRole } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Role as a parameter" { - $CommandUnderTest | Should -HaveParameter Role -Type System.String[] + $CommandUnderTest | Should -HaveParameter Role } It "Should have Owner as a parameter" { - $CommandUnderTest | Should -HaveParameter Owner -Type System.String + $CommandUnderTest | Should -HaveParameter Owner } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaDbSchema.Tests.ps1 b/tests/New-DbaDbSchema.Tests.ps1 index 8132c040be..3bd4cfdff5 100644 --- a/tests/New-DbaDbSchema.Tests.ps1 +++ b/tests/New-DbaDbSchema.Tests.ps1 @@ -6,25 +6,25 @@ Describe "New-DbaDbSchema" { $CommandUnderTest = Get-Command New-DbaDbSchema } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Schema parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String[] + $CommandUnderTest | Should -HaveParameter Schema } It "Should have SchemaOwner parameter" { - $CommandUnderTest | Should -HaveParameter SchemaOwner -Type System.String + $CommandUnderTest | Should -HaveParameter SchemaOwner } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter EnableException } } } @@ -34,7 +34,7 @@ Describe "New-DbaDbSchema Integration Tests" -Tag "IntegrationTests" { $random = Get-Random $server1 = Connect-DbaInstance -SqlInstance $global:instance1 $server2 = Connect-DbaInstance -SqlInstance $global:instance2 - $null = Get-DbaProcess -SqlInstance $server1, $server2 | Where-Object Program -match dbatools | Stop-DbaProcess -Confirm:$false + $null = Get-DbaProcess -SqlInstance $server1, $server2 | Where-Object Program -match dbatools | Stop-DbaProcess $newDbName = "dbatoolsci_newdb_$random" $newDbs = New-DbaDatabase -SqlInstance $server1, $server2 -Name $newDbName @@ -47,8 +47,8 @@ Describe "New-DbaDbSchema Integration Tests" -Tag "IntegrationTests" { } AfterAll { - $null = $newDbs | Remove-DbaDatabase -Confirm:$false - $null = $logins | Remove-DbaLogin -Confirm:$false + $null = $newDbs | Remove-DbaDatabase + $null = $logins | Remove-DbaLogin } Context "commands work as expected" { diff --git a/tests/New-DbaDbSequence.Tests.ps1 b/tests/New-DbaDbSequence.Tests.ps1 index 4560fb68a6..36fe131bd3 100644 --- a/tests/New-DbaDbSequence.Tests.ps1 +++ b/tests/New-DbaDbSequence.Tests.ps1 @@ -25,46 +25,46 @@ Describe "New-DbaDbSequence" { $CommandUnderTest = Get-Command New-DbaDbSequence } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Sequence parameter" { - $CommandUnderTest | Should -HaveParameter Sequence -Type System.String[] + $CommandUnderTest | Should -HaveParameter Sequence } It "Should have Schema parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String + $CommandUnderTest | Should -HaveParameter Schema } It "Should have IntegerType parameter" { - $CommandUnderTest | Should -HaveParameter IntegerType -Type System.String + $CommandUnderTest | Should -HaveParameter IntegerType } It "Should have StartWith parameter" { - $CommandUnderTest | Should -HaveParameter StartWith -Type System.Int64 + $CommandUnderTest | Should -HaveParameter StartWith } It "Should have IncrementBy parameter" { - $CommandUnderTest | Should -HaveParameter IncrementBy -Type System.Int64 + $CommandUnderTest | Should -HaveParameter IncrementBy } It "Should have MinValue parameter" { - $CommandUnderTest | Should -HaveParameter MinValue -Type System.Int64 + $CommandUnderTest | Should -HaveParameter MinValue } It "Should have MaxValue parameter" { - $CommandUnderTest | Should -HaveParameter MaxValue -Type System.Int64 + $CommandUnderTest | Should -HaveParameter MaxValue } It "Should have Cycle parameter" { - $CommandUnderTest | Should -HaveParameter Cycle -Type Switch + $CommandUnderTest | Should -HaveParameter Cycle } It "Should have CacheSize parameter" { - $CommandUnderTest | Should -HaveParameter CacheSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter CacheSize } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaDbSnapshot.Tests.ps1 b/tests/New-DbaDbSnapshot.Tests.ps1 index 350cb9ab5e..a4228f3a8b 100644 --- a/tests/New-DbaDbSnapshot.Tests.ps1 +++ b/tests/New-DbaDbSnapshot.Tests.ps1 @@ -11,37 +11,37 @@ Describe "New-DbaDbSnapshot" { $CommandUnderTest = Get-Command New-DbaDbSnapshot } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have AllDatabases as a switch parameter" { - $CommandUnderTest | Should -HaveParameter AllDatabases -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AllDatabases } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String + $CommandUnderTest | Should -HaveParameter Name } It "Should have NameSuffix as a parameter" { - $CommandUnderTest | Should -HaveParameter NameSuffix -Type System.String + $CommandUnderTest | Should -HaveParameter NameSuffix } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaDbSynonym.Tests.ps1 b/tests/New-DbaDbSynonym.Tests.ps1 index 8d612fb719..0aa236a82f 100644 --- a/tests/New-DbaDbSynonym.Tests.ps1 +++ b/tests/New-DbaDbSynonym.Tests.ps1 @@ -22,40 +22,40 @@ Describe "New-DbaDbSynonym" { $CommandUnderTest = Get-Command New-DbaDbSynonym } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Synonym as a parameter" { - $CommandUnderTest | Should -HaveParameter Synonym -Type System.String + $CommandUnderTest | Should -HaveParameter Synonym } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String + $CommandUnderTest | Should -HaveParameter Schema } It "Should have BaseServer as a parameter" { - $CommandUnderTest | Should -HaveParameter BaseServer -Type System.String + $CommandUnderTest | Should -HaveParameter BaseServer } It "Should have BaseDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter BaseDatabase -Type System.String + $CommandUnderTest | Should -HaveParameter BaseDatabase } It "Should have BaseSchema as a parameter" { - $CommandUnderTest | Should -HaveParameter BaseSchema -Type System.String + $CommandUnderTest | Should -HaveParameter BaseSchema } It "Should have BaseObject as a parameter" { - $CommandUnderTest | Should -HaveParameter BaseObject -Type System.String + $CommandUnderTest | Should -HaveParameter BaseObject } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaDbTable.Tests.ps1 b/tests/New-DbaDbTable.Tests.ps1 index b36bf9cbc9..0e9485a276 100644 --- a/tests/New-DbaDbTable.Tests.ps1 +++ b/tests/New-DbaDbTable.Tests.ps1 @@ -25,25 +25,25 @@ Describe "New-DbaDbTable" { $CommandUnderTest = Get-Command New-DbaDbTable } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String + $CommandUnderTest | Should -HaveParameter Name } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String + $CommandUnderTest | Should -HaveParameter Schema } It "Should have ColumnMap as a parameter" { - $CommandUnderTest | Should -HaveParameter ColumnMap -Type System.Collections.Hashtable[Microsoft.SqlServer.Management.Smo.Table[]] + $CommandUnderTest | Should -HaveParameter ColumnMap } It "Should have ColumnObject as a parameter" { - $CommandUnderTest | Should -HaveParameter ColumnObject -Type Microsoft.SqlServer.Management.Smo.Column[] + $CommandUnderTest | Should -HaveParameter ColumnObject } # Add more parameter checks as needed } diff --git a/tests/New-DbaDbTransfer.Tests.ps1 b/tests/New-DbaDbTransfer.Tests.ps1 index 98c50430f7..9bfa436a37 100644 --- a/tests/New-DbaDbTransfer.Tests.ps1 +++ b/tests/New-DbaDbTransfer.Tests.ps1 @@ -74,49 +74,49 @@ Describe "New-DbaDbTransfer" { $CommandUnderTest = Get-Command New-DbaDbTransfer } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have DestinationSqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlInstance -Type DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter DestinationSqlInstance } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have DestinationDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationDatabase -Type System.String + $CommandUnderTest | Should -HaveParameter DestinationDatabase } It "Should have BatchSize as a parameter" { - $CommandUnderTest | Should -HaveParameter BatchSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BatchSize } It "Should have BulkCopyTimeOut as a parameter" { - $CommandUnderTest | Should -HaveParameter BulkCopyTimeOut -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BulkCopyTimeOut } It "Should have ScriptingOption as a parameter" { - $CommandUnderTest | Should -HaveParameter ScriptingOption -Type Microsoft.SqlServer.Management.Smo.ScriptingOptions + $CommandUnderTest | Should -HaveParameter ScriptingOption } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.NamedSmoObject[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have CopyAllObjects as a switch parameter" { - $CommandUnderTest | Should -HaveParameter CopyAllObjects -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter CopyAllObjects } It "Should have CopyAll as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyAll -Type String[] + $CommandUnderTest | Should -HaveParameter CopyAll } It "Should have SchemaOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter SchemaOnly -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter SchemaOnly } It "Should have DataOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DataOnly -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DataOnly } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaDbUser.Tests.ps1 b/tests/New-DbaDbUser.Tests.ps1 index b8d0ec2e14..bb8c84c31d 100644 --- a/tests/New-DbaDbUser.Tests.ps1 +++ b/tests/New-DbaDbUser.Tests.ps1 @@ -31,40 +31,40 @@ Describe "New-DbaDbUser" { $CommandUnderTest = Get-Command New-DbaDbUser } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have IncludeSystem as a parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystem -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeSystem } It "Should have User as a parameter" { - $CommandUnderTest | Should -HaveParameter User -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter User } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Login } It "Should have SecurePassword as a parameter" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type System.Security.SecureString -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SecurePassword } It "Should have ExternalProvider as a parameter" { - $CommandUnderTest | Should -HaveParameter ExternalProvider -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExternalProvider } It "Should have DefaultSchema as a parameter" { - $CommandUnderTest | Should -HaveParameter DefaultSchema -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DefaultSchema } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaDiagnosticAdsNotebook.Tests.ps1 b/tests/New-DbaDiagnosticAdsNotebook.Tests.ps1 index 7ba85c19c4..ffe8f9c957 100644 --- a/tests/New-DbaDiagnosticAdsNotebook.Tests.ps1 +++ b/tests/New-DbaDiagnosticAdsNotebook.Tests.ps1 @@ -6,22 +6,22 @@ Describe "New-DbaDiagnosticAdsNotebook" { $CommandUnderTest = Get-Command New-DbaDiagnosticAdsNotebook } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have TargetVersion as a parameter" { - $CommandUnderTest | Should -HaveParameter TargetVersion -Type System.String + $CommandUnderTest | Should -HaveParameter TargetVersion } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have IncludeDatabaseSpecific as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeDatabaseSpecific -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeDatabaseSpecific } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaDirectory.Tests.ps1 b/tests/New-DbaDirectory.Tests.ps1 index 19f3a2113f..b8837b3686 100644 --- a/tests/New-DbaDirectory.Tests.ps1 +++ b/tests/New-DbaDirectory.Tests.ps1 @@ -9,23 +9,23 @@ Describe "New-DbaDirectory" { BeforeAll { $CommandUnderTest = Get-Command New-DbaDirectory } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have Path as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Confirm } } diff --git a/tests/New-DbaEndpoint.Tests.ps1 b/tests/New-DbaEndpoint.Tests.ps1 index 26f77b4dfc..dbe40c9245 100644 --- a/tests/New-DbaEndpoint.Tests.ps1 +++ b/tests/New-DbaEndpoint.Tests.ps1 @@ -12,49 +12,49 @@ Describe "New-DbaEndpoint" { $CommandUnderTest = Get-Command New-DbaEndpoint } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String + $CommandUnderTest | Should -HaveParameter Name } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String + $CommandUnderTest | Should -HaveParameter Type } It "Should have Protocol as a parameter" { - $CommandUnderTest | Should -HaveParameter Protocol -Type System.String + $CommandUnderTest | Should -HaveParameter Protocol } It "Should have Role as a parameter" { - $CommandUnderTest | Should -HaveParameter Role -Type System.String + $CommandUnderTest | Should -HaveParameter Role } It "Should have EndpointEncryption as a parameter" { - $CommandUnderTest | Should -HaveParameter EndpointEncryption -Type System.String + $CommandUnderTest | Should -HaveParameter EndpointEncryption } It "Should have EncryptionAlgorithm as a parameter" { - $CommandUnderTest | Should -HaveParameter EncryptionAlgorithm -Type System.String + $CommandUnderTest | Should -HaveParameter EncryptionAlgorithm } It "Should have AuthenticationOrder as a parameter" { - $CommandUnderTest | Should -HaveParameter AuthenticationOrder -Type System.String + $CommandUnderTest | Should -HaveParameter AuthenticationOrder } It "Should have Certificate as a parameter" { - $CommandUnderTest | Should -HaveParameter Certificate -Type System.String + $CommandUnderTest | Should -HaveParameter Certificate } It "Should have IPAddress as a parameter" { - $CommandUnderTest | Should -HaveParameter IPAddress -Type System.Net.IPAddress + $CommandUnderTest | Should -HaveParameter IPAddress } It "Should have Port as a parameter" { - $CommandUnderTest | Should -HaveParameter Port -Type System.Int32 + $CommandUnderTest | Should -HaveParameter Port } It "Should have SslPort as a parameter" { - $CommandUnderTest | Should -HaveParameter SslPort -Type System.Int32 + $CommandUnderTest | Should -HaveParameter SslPort } It "Should have Owner as a parameter" { - $CommandUnderTest | Should -HaveParameter Owner -Type System.String + $CommandUnderTest | Should -HaveParameter Owner } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -72,12 +72,12 @@ Describe "New-DbaEndpoint" { } It "creates an endpoint of the db mirroring type" { - $results = New-DbaEndpoint -SqlInstance $global:instance2 -Type DatabaseMirroring -Role Partner -Name Mirroring -Confirm:$false | Start-DbaEndpoint -Confirm:$false + $results = New-DbaEndpoint -SqlInstance $global:instance2 -Type DatabaseMirroring -Role Partner -Name Mirroring | Start-DbaEndpoint $results.EndpointType | Should -Be 'DatabaseMirroring' } It "creates it with the right owner" { - $results = New-DbaEndpoint -SqlInstance $global:instance2 -Type DatabaseMirroring -Role Partner -Name Mirroring -Confirm:$false | Start-DbaEndpoint -Confirm:$false + $results = New-DbaEndpoint -SqlInstance $global:instance2 -Type DatabaseMirroring -Role Partner -Name Mirroring | Start-DbaEndpoint $sa = Get-SaLoginName -SqlInstance $global:instance2 $results.Owner | Should -Be $sa } diff --git a/tests/New-DbaFirewallRule.Tests.ps1 b/tests/New-DbaFirewallRule.Tests.ps1 index 98ede97106..05f8e25406 100644 --- a/tests/New-DbaFirewallRule.Tests.ps1 +++ b/tests/New-DbaFirewallRule.Tests.ps1 @@ -6,22 +6,22 @@ Describe "New-DbaFirewallRule" { $CommandUnderTest = Get-Command New-DbaFirewallRule } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type } It "Should have Configuration parameter" { - $CommandUnderTest | Should -HaveParameter Configuration -Type System.Collections.Hashtable -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Configuration } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaLinkedServer.Tests.ps1 b/tests/New-DbaLinkedServer.Tests.ps1 index c0e6bff927..19c23061c6 100644 --- a/tests/New-DbaLinkedServer.Tests.ps1 +++ b/tests/New-DbaLinkedServer.Tests.ps1 @@ -31,46 +31,46 @@ Describe "New-DbaLinkedServer" { $CommandUnderTest = Get-Command New-DbaLinkedServer } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have LinkedServer as a parameter" { - $CommandUnderTest | Should -HaveParameter LinkedServer -Type System.String + $CommandUnderTest | Should -HaveParameter LinkedServer } It "Should have ServerProduct as a parameter" { - $CommandUnderTest | Should -HaveParameter ServerProduct -Type System.String + $CommandUnderTest | Should -HaveParameter ServerProduct } It "Should have Provider as a parameter" { - $CommandUnderTest | Should -HaveParameter Provider -Type System.String + $CommandUnderTest | Should -HaveParameter Provider } It "Should have DataSource as a parameter" { - $CommandUnderTest | Should -HaveParameter DataSource -Type System.String + $CommandUnderTest | Should -HaveParameter DataSource } It "Should have Location as a parameter" { - $CommandUnderTest | Should -HaveParameter Location -Type System.String + $CommandUnderTest | Should -HaveParameter Location } It "Should have ProviderString as a parameter" { - $CommandUnderTest | Should -HaveParameter ProviderString -Type System.String + $CommandUnderTest | Should -HaveParameter ProviderString } It "Should have Catalog as a parameter" { - $CommandUnderTest | Should -HaveParameter Catalog -Type System.String + $CommandUnderTest | Should -HaveParameter Catalog } It "Should have SecurityContext as a parameter" { - $CommandUnderTest | Should -HaveParameter SecurityContext -Type System.String + $CommandUnderTest | Should -HaveParameter SecurityContext } It "Should have SecurityContextRemoteUser as a parameter" { - $CommandUnderTest | Should -HaveParameter SecurityContextRemoteUser -Type System.String + $CommandUnderTest | Should -HaveParameter SecurityContextRemoteUser } It "Should have SecurityContextRemoteUserPassword as a parameter" { - $CommandUnderTest | Should -HaveParameter SecurityContextRemoteUserPassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter SecurityContextRemoteUserPassword } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Server[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaLinkedServerLogin.Tests.ps1 b/tests/New-DbaLinkedServerLogin.Tests.ps1 index bd6a6f991f..a2e67947b9 100644 --- a/tests/New-DbaLinkedServerLogin.Tests.ps1 +++ b/tests/New-DbaLinkedServerLogin.Tests.ps1 @@ -6,31 +6,31 @@ Describe "New-DbaLinkedServerLogin" { $CommandUnderTest = Get-Command New-DbaLinkedServerLogin } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have LinkedServer parameter" { - $CommandUnderTest | Should -HaveParameter LinkedServer -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LinkedServer } It "Should have LocalLogin parameter" { - $CommandUnderTest | Should -HaveParameter LocalLogin -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LocalLogin } It "Should have RemoteUser parameter" { - $CommandUnderTest | Should -HaveParameter RemoteUser -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter RemoteUser } It "Should have RemoteUserPassword parameter" { - $CommandUnderTest | Should -HaveParameter RemoteUserPassword -Type System.Security.SecureString -Mandatory:$false + $CommandUnderTest | Should -HaveParameter RemoteUserPassword } It "Should have Impersonate parameter" { - $CommandUnderTest | Should -HaveParameter Impersonate -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Impersonate } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.LinkedServer[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/New-DbaLogin.Tests.ps1 b/tests/New-DbaLogin.Tests.ps1 index 2e6525a507..c8abe081dc 100644 --- a/tests/New-DbaLogin.Tests.ps1 +++ b/tests/New-DbaLogin.Tests.ps1 @@ -70,70 +70,70 @@ Describe "New-DbaLogin" { $Command = Get-Command -Name $CommandName } It "Should have SqlInstance parameter" { - $Command | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] -Mandatory:$false + $Command | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $Command | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $Command | Should -HaveParameter SqlCredential } It "Should have Login parameter" { - $Command | Should -HaveParameter Login -Type System.String[] -Mandatory:$false + $Command | Should -HaveParameter Login } It "Should have InputObject parameter" { - $Command | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $Command | Should -HaveParameter InputObject } It "Should have LoginRenameHashtable parameter" { - $Command | Should -HaveParameter LoginRenameHashtable -Type System.Collections.Hashtable -Mandatory:$false + $Command | Should -HaveParameter LoginRenameHashtable } It "Should have SecurePassword parameter" { - $Command | Should -HaveParameter SecurePassword -Type System.Security.SecureString -Mandatory:$false + $Command | Should -HaveParameter SecurePassword } It "Should have HashedPassword parameter" { - $Command | Should -HaveParameter HashedPassword -Type System.String -Mandatory:$false + $Command | Should -HaveParameter HashedPassword } It "Should have MapToCertificate parameter" { - $Command | Should -HaveParameter MapToCertificate -Type System.String -Mandatory:$false + $Command | Should -HaveParameter MapToCertificate } It "Should have MapToAsymmetricKey parameter" { - $Command | Should -HaveParameter MapToAsymmetricKey -Type System.String -Mandatory:$false + $Command | Should -HaveParameter MapToAsymmetricKey } It "Should have MapToCredential parameter" { - $Command | Should -HaveParameter MapToCredential -Type System.String -Mandatory:$false + $Command | Should -HaveParameter MapToCredential } It "Should have Sid parameter" { - $Command | Should -HaveParameter Sid -Type System.Object -Mandatory:$false + $Command | Should -HaveParameter Sid } It "Should have DefaultDatabase parameter" { - $Command | Should -HaveParameter DefaultDatabase -Type System.String -Mandatory:$false + $Command | Should -HaveParameter DefaultDatabase } It "Should have Language parameter" { - $Command | Should -HaveParameter Language -Type System.String -Mandatory:$false + $Command | Should -HaveParameter Language } It "Should have PasswordExpirationEnabled parameter" { - $Command | Should -HaveParameter PasswordExpirationEnabled -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $Command | Should -HaveParameter PasswordExpirationEnabled } It "Should have PasswordPolicyEnforced parameter" { - $Command | Should -HaveParameter PasswordPolicyEnforced -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $Command | Should -HaveParameter PasswordPolicyEnforced } It "Should have PasswordMustChange parameter" { - $Command | Should -HaveParameter PasswordMustChange -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $Command | Should -HaveParameter PasswordMustChange } It "Should have Disabled parameter" { - $Command | Should -HaveParameter Disabled -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $Command | Should -HaveParameter Disabled } It "Should have DenyWindowsLogin parameter" { - $Command | Should -HaveParameter DenyWindowsLogin -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $Command | Should -HaveParameter DenyWindowsLogin } It "Should have NewSid parameter" { - $Command | Should -HaveParameter NewSid -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $Command | Should -HaveParameter NewSid } It "Should have ExternalProvider parameter" { - $Command | Should -HaveParameter ExternalProvider -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $Command | Should -HaveParameter ExternalProvider } It "Should have Force parameter" { - $Command | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $Command | Should -HaveParameter Force } It "Should have EnableException parameter" { - $Command | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $Command | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaReplCreationScriptOptions.Tests.ps1 b/tests/New-DbaReplCreationScriptOptions.Tests.ps1 index df1091ddf4..de71a8e674 100644 --- a/tests/New-DbaReplCreationScriptOptions.Tests.ps1 +++ b/tests/New-DbaReplCreationScriptOptions.Tests.ps1 @@ -10,11 +10,11 @@ Describe "New-DbaReplCreationScriptOptions" { BeforeAll { $CommandUnderTest = Get-Command New-DbaReplCreationScriptOptions } - It "Should have Options as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Options -Type System.String[] -Mandatory:$false + It "Should have Options as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Options } It "Should have NoDefaults as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter NoDefaults -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoDefaults } } } diff --git a/tests/New-DbaReplPublication.Tests.ps1 b/tests/New-DbaReplPublication.Tests.ps1 index 0bde55ec2f..542cc752cc 100644 --- a/tests/New-DbaReplPublication.Tests.ps1 +++ b/tests/New-DbaReplPublication.Tests.ps1 @@ -11,25 +11,25 @@ Describe "New-DbaReplPublication" { $CommandUnderTest = Get-Command New-DbaReplPublication } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have Name parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String + $CommandUnderTest | Should -HaveParameter Name } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String + $CommandUnderTest | Should -HaveParameter Type } It "Should have LogReaderAgentCredential parameter" { - $CommandUnderTest | Should -HaveParameter LogReaderAgentCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter LogReaderAgentCredential } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/New-DbaReplSubscription.Tests.ps1 b/tests/New-DbaReplSubscription.Tests.ps1 index fc8bcecc08..ac85f82762 100644 --- a/tests/New-DbaReplSubscription.Tests.ps1 +++ b/tests/New-DbaReplSubscription.Tests.ps1 @@ -11,37 +11,37 @@ Describe "New-DbaReplSubscription" { $CommandUnderTest = Get-Command New-DbaReplSubscription } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have SubscriberSqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SubscriberSqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SubscriberSqlInstance } It "Should have SubscriberSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SubscriberSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SubscriberSqlCredential } It "Should have SubscriptionDatabase parameter" { - $CommandUnderTest | Should -HaveParameter SubscriptionDatabase -Type System.String + $CommandUnderTest | Should -HaveParameter SubscriptionDatabase } It "Should have PublicationName parameter" { - $CommandUnderTest | Should -HaveParameter PublicationName -Type System.String + $CommandUnderTest | Should -HaveParameter PublicationName } It "Should have SubscriptionSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SubscriptionSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SubscriptionSqlCredential } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String + $CommandUnderTest | Should -HaveParameter Type } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have Confirm parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Confirm } } } diff --git a/tests/New-DbaRgResourcePool.Tests.ps1 b/tests/New-DbaRgResourcePool.Tests.ps1 index 52b2ec0e97..1574c77a96 100644 --- a/tests/New-DbaRgResourcePool.Tests.ps1 +++ b/tests/New-DbaRgResourcePool.Tests.ps1 @@ -10,49 +10,49 @@ Describe "New-DbaRgResourcePool" { $CommandUnderTest = Get-Command New-DbaRgResourcePool } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential } It "Should have ResourcePool parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePool -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ResourcePool -Type System.String[] } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type -Type System.String } It "Should have MinimumCpuPercentage parameter" { - $CommandUnderTest | Should -HaveParameter MinimumCpuPercentage -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MinimumCpuPercentage -Type System.Int32 } It "Should have MaximumCpuPercentage parameter" { - $CommandUnderTest | Should -HaveParameter MaximumCpuPercentage -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaximumCpuPercentage -Type System.Int32 } It "Should have CapCpuPercentage parameter" { - $CommandUnderTest | Should -HaveParameter CapCpuPercentage -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CapCpuPercentage -Type System.Int32 } It "Should have MinimumMemoryPercentage parameter" { - $CommandUnderTest | Should -HaveParameter MinimumMemoryPercentage -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MinimumMemoryPercentage -Type System.Int32 } It "Should have MaximumMemoryPercentage parameter" { - $CommandUnderTest | Should -HaveParameter MaximumMemoryPercentage -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaximumMemoryPercentage -Type System.Int32 } It "Should have MinimumIOPSPerVolume parameter" { - $CommandUnderTest | Should -HaveParameter MinimumIOPSPerVolume -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MinimumIOPSPerVolume -Type System.Int32 } It "Should have MaximumIOPSPerVolume parameter" { - $CommandUnderTest | Should -HaveParameter MaximumIOPSPerVolume -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaximumIOPSPerVolume -Type System.Int32 } It "Should have MaximumProcesses parameter" { - $CommandUnderTest | Should -HaveParameter MaximumProcesses -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaximumProcesses -Type System.Int32 } It "Should have SkipReconfigure parameter" { - $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type System.Management.Automation.SwitchParameter } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter } } diff --git a/tests/New-DbaRgWorkloadGroup.Tests.ps1 b/tests/New-DbaRgWorkloadGroup.Tests.ps1 index c080bda0ef..31442a6497 100644 --- a/tests/New-DbaRgWorkloadGroup.Tests.ps1 +++ b/tests/New-DbaRgWorkloadGroup.Tests.ps1 @@ -12,46 +12,46 @@ Describe "New-DbaRgWorkloadGroup" { $CommandUnderTest = Get-Command New-DbaRgWorkloadGroup } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have WorkloadGroup parameter" { - $CommandUnderTest | Should -HaveParameter WorkloadGroup -Type System.String[] + $CommandUnderTest | Should -HaveParameter WorkloadGroup } It "Should have ResourcePool parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePool -Type System.String + $CommandUnderTest | Should -HaveParameter ResourcePool } It "Should have ResourcePoolType parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePoolType -Type System.String + $CommandUnderTest | Should -HaveParameter ResourcePoolType } It "Should have Importance parameter" { - $CommandUnderTest | Should -HaveParameter Importance -Type System.String + $CommandUnderTest | Should -HaveParameter Importance } It "Should have RequestMaximumMemoryGrantPercentage parameter" { - $CommandUnderTest | Should -HaveParameter RequestMaximumMemoryGrantPercentage -Type System.Int32 + $CommandUnderTest | Should -HaveParameter RequestMaximumMemoryGrantPercentage } It "Should have RequestMaximumCpuTimeInSeconds parameter" { - $CommandUnderTest | Should -HaveParameter RequestMaximumCpuTimeInSeconds -Type System.Int32 + $CommandUnderTest | Should -HaveParameter RequestMaximumCpuTimeInSeconds } It "Should have RequestMemoryGrantTimeoutInSeconds parameter" { - $CommandUnderTest | Should -HaveParameter RequestMemoryGrantTimeoutInSeconds -Type System.Int32 + $CommandUnderTest | Should -HaveParameter RequestMemoryGrantTimeoutInSeconds } It "Should have MaximumDegreeOfParallelism parameter" { - $CommandUnderTest | Should -HaveParameter MaximumDegreeOfParallelism -Type System.Int32 + $CommandUnderTest | Should -HaveParameter MaximumDegreeOfParallelism } It "Should have GroupMaximumRequests parameter" { - $CommandUnderTest | Should -HaveParameter GroupMaximumRequests -Type System.Int32 + $CommandUnderTest | Should -HaveParameter GroupMaximumRequests } It "Should have SkipReconfigure parameter" { - $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter SkipReconfigure } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaScriptingOption.Tests.ps1 b/tests/New-DbaScriptingOption.Tests.ps1 index ad38ecb40b..93d0f8ad50 100644 --- a/tests/New-DbaScriptingOption.Tests.ps1 +++ b/tests/New-DbaScriptingOption.Tests.ps1 @@ -12,8 +12,8 @@ Describe "New-DbaScriptingOption" { $CommandUnderTest = Get-Command New-DbaScriptingOption } It "Should have the correct parameters" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory -Alias 'ConnectionString' - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlInstance -Alias 'ConnectionString' + $CommandUnderTest | Should -HaveParameter SqlCredential # Add more parameter checks as needed } } diff --git a/tests/New-DbaServerRole.Tests.ps1 b/tests/New-DbaServerRole.Tests.ps1 index ba6b57f0db..384d49a790 100644 --- a/tests/New-DbaServerRole.Tests.ps1 +++ b/tests/New-DbaServerRole.Tests.ps1 @@ -10,19 +10,19 @@ Describe "New-DbaServerRole" { $CommandUnderTest = Get-Command New-DbaServerRole } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have ServerRole as a parameter" { - $CommandUnderTest | Should -HaveParameter ServerRole -Type System.String[] + $CommandUnderTest | Should -HaveParameter ServerRole } It "Should have Owner as a parameter" { - $CommandUnderTest | Should -HaveParameter Owner -Type System.String + $CommandUnderTest | Should -HaveParameter Owner } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -34,7 +34,7 @@ Describe "New-DbaServerRole" { $owner = "sa" } AfterEach { - $null = Remove-DbaServerRole -SqlInstance $instance -ServerRole $roleExecutor, $roleMaster -Confirm:$false + $null = Remove-DbaServerRole -SqlInstance $instance -ServerRole $roleExecutor, $roleMaster } It 'Add new server-role and returns results' { diff --git a/tests/New-DbaServiceMasterKey.Tests.ps1 b/tests/New-DbaServiceMasterKey.Tests.ps1 index 6482cbfebc..7d0968ee71 100644 --- a/tests/New-DbaServiceMasterKey.Tests.ps1 +++ b/tests/New-DbaServiceMasterKey.Tests.ps1 @@ -6,19 +6,19 @@ Describe "New-DbaServiceMasterKey" { $CommandUnderTest = Get-Command New-DbaServiceMasterKey } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.SqlServer.Management.Smo.Credential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type Microsoft.SqlServer.Management.Smo.Credential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have SecurePassword as a parameter" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter SecurePassword } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/New-DbaSqlParameter.Tests.ps1 b/tests/New-DbaSqlParameter.Tests.ps1 index 861c9bb08e..a33f11e5dc 100644 --- a/tests/New-DbaSqlParameter.Tests.ps1 +++ b/tests/New-DbaSqlParameter.Tests.ps1 @@ -5,65 +5,65 @@ Describe "New-DbaSqlParameter" { BeforeAll { $CommandUnderTest = Get-Command New-DbaSqlParameter } - It "Should have CompareInfo as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter CompareInfo -Type System.String -Mandatory:$false + It "Should have CompareInfo as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter CompareInfo } - It "Should have DbType as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter DbType -Type System.String -Mandatory:$false + It "Should have DbType as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter DbType } - It "Should have Direction as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Direction -Type System.String -Mandatory:$false + It "Should have Direction as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Direction } - It "Should have ForceColumnEncryption as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter ForceColumnEncryption -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have ForceColumnEncryption as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ForceColumnEncryption } - It "Should have IsNullable as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter IsNullable -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have IsNullable as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter IsNullable } - It "Should have LocaleId as a non-mandatory System.Int32 parameter" { - $CommandUnderTest | Should -HaveParameter LocaleId -Type System.Int32 -Mandatory:$false + It "Should have LocaleId as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter LocaleId } - It "Should have Offset as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Offset -Type System.String -Mandatory:$false + It "Should have Offset as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Offset } - It "Should have ParameterName as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter ParameterName -Type System.String -Mandatory:$false + It "Should have ParameterName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ParameterName } - It "Should have Precision as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Precision -Type System.String -Mandatory:$false + It "Should have Precision as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Precision } - It "Should have Scale as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Scale -Type System.String -Mandatory:$false + It "Should have Scale as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Scale } - It "Should have Size as a non-mandatory System.Int32 parameter" { - $CommandUnderTest | Should -HaveParameter Size -Type System.Int32 -Mandatory:$false + It "Should have Size as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Size } - It "Should have SourceColumn as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter SourceColumn -Type System.String -Mandatory:$false + It "Should have SourceColumn as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SourceColumn } - It "Should have SourceColumnNullMapping as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter SourceColumnNullMapping -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have SourceColumnNullMapping as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SourceColumnNullMapping } - It "Should have SourceVersion as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter SourceVersion -Type System.String -Mandatory:$false + It "Should have SourceVersion as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SourceVersion } - It "Should have SqlDbType as a non-mandatory Microsoft.Data.SqlClient.SqlDbType parameter" { - $CommandUnderTest | Should -HaveParameter SqlDbType -Type Microsoft.Data.SqlClient.SqlDbType -Mandatory:$false + It "Should have SqlDbType as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlDbType } - It "Should have SqlValue as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter SqlValue -Type System.String -Mandatory:$false + It "Should have SqlValue as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlValue } - It "Should have TypeName as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter TypeName -Type System.String -Mandatory:$false + It "Should have TypeName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter TypeName } - It "Should have UdtTypeName as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter UdtTypeName -Type System.String -Mandatory:$false + It "Should have UdtTypeName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter UdtTypeName } - It "Should have Value as a non-mandatory System.Object parameter" { - $CommandUnderTest | Should -HaveParameter Value -Type System.Object -Mandatory:$false + It "Should have Value as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Value } - It "Should have EnableException as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have EnableException as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/New-DbaSsisCatalog.Tests.ps1 b/tests/New-DbaSsisCatalog.Tests.ps1 index e552a97b87..277dd05f37 100644 --- a/tests/New-DbaSsisCatalog.Tests.ps1 +++ b/tests/New-DbaSsisCatalog.Tests.ps1 @@ -6,22 +6,22 @@ Describe "New-DbaSsisCatalog" { $CommandUnderTest = Get-Command New-DbaSsisCatalog } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have SecurePassword as a parameter" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter SecurePassword } It "Should have SsisCatalog as a parameter" { - $CommandUnderTest | Should -HaveParameter SsisCatalog -Type System.String + $CommandUnderTest | Should -HaveParameter SsisCatalog } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaXESession.Tests.ps1 b/tests/New-DbaXESession.Tests.ps1 index a9ec6339a8..003b20550b 100644 --- a/tests/New-DbaXESession.Tests.ps1 +++ b/tests/New-DbaXESession.Tests.ps1 @@ -9,23 +9,23 @@ Describe "New-DbaXESession" { BeforeAll { $CommandUnderTest = Get-Command New-DbaXESession } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Name as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String -Mandatory:$false + It "Should have Name as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Name } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Confirm } } diff --git a/tests/New-DbaXESmartCsvWriter.Tests.ps1 b/tests/New-DbaXESmartCsvWriter.Tests.ps1 index 068d2d5610..74556aa1b0 100644 --- a/tests/New-DbaXESmartCsvWriter.Tests.ps1 +++ b/tests/New-DbaXESmartCsvWriter.Tests.ps1 @@ -12,22 +12,22 @@ Describe "New-DbaXESmartCsvWriter" { $CommandUnderTest = Get-Command New-DbaXESmartCsvWriter } It "Should have OutputFile as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter OutputFile -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OutputFile } It "Should have Overwrite as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter Overwrite -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Overwrite } It "Should have Event as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter Event -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Event } It "Should have OutputColumn as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter OutputColumn -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OutputColumn } It "Should have Filter as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Filter -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Filter } It "Should have EnableException as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaXESmartEmail.Tests.ps1 b/tests/New-DbaXESmartEmail.Tests.ps1 index b4c8c1aa49..94a771a8e9 100644 --- a/tests/New-DbaXESmartEmail.Tests.ps1 +++ b/tests/New-DbaXESmartEmail.Tests.ps1 @@ -12,46 +12,46 @@ Describe "New-DbaXESmartEmail" { $CommandUnderTest = Get-Command New-DbaXESmartEmail } It "Should have SmtpServer parameter" { - $CommandUnderTest | Should -HaveParameter SmtpServer -Type System.String + $CommandUnderTest | Should -HaveParameter SmtpServer } It "Should have Sender parameter" { - $CommandUnderTest | Should -HaveParameter Sender -Type System.String + $CommandUnderTest | Should -HaveParameter Sender } It "Should have To parameter" { - $CommandUnderTest | Should -HaveParameter To -Type System.String[] + $CommandUnderTest | Should -HaveParameter To } It "Should have Cc parameter" { - $CommandUnderTest | Should -HaveParameter Cc -Type System.String[] + $CommandUnderTest | Should -HaveParameter Cc } It "Should have Bcc parameter" { - $CommandUnderTest | Should -HaveParameter Bcc -Type System.String[] + $CommandUnderTest | Should -HaveParameter Bcc } It "Should have Credential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Subject parameter" { - $CommandUnderTest | Should -HaveParameter Subject -Type System.String + $CommandUnderTest | Should -HaveParameter Subject } It "Should have Body parameter" { - $CommandUnderTest | Should -HaveParameter Body -Type System.String + $CommandUnderTest | Should -HaveParameter Body } It "Should have Attachment parameter" { - $CommandUnderTest | Should -HaveParameter Attachment -Type System.String + $CommandUnderTest | Should -HaveParameter Attachment } It "Should have AttachmentFileName parameter" { - $CommandUnderTest | Should -HaveParameter AttachmentFileName -Type System.String + $CommandUnderTest | Should -HaveParameter AttachmentFileName } It "Should have PlainText parameter" { - $CommandUnderTest | Should -HaveParameter PlainText -Type System.String + $CommandUnderTest | Should -HaveParameter PlainText } It "Should have Event parameter" { - $CommandUnderTest | Should -HaveParameter Event -Type System.String[] + $CommandUnderTest | Should -HaveParameter Event } It "Should have Filter parameter" { - $CommandUnderTest | Should -HaveParameter Filter -Type System.String + $CommandUnderTest | Should -HaveParameter Filter } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbaXESmartQueryExec.Tests.ps1 b/tests/New-DbaXESmartQueryExec.Tests.ps1 index e4c22f76cf..5b5334792e 100644 --- a/tests/New-DbaXESmartQueryExec.Tests.ps1 +++ b/tests/New-DbaXESmartQueryExec.Tests.ps1 @@ -12,25 +12,25 @@ Describe "New-DbaXESmartQueryExec" { $CommandUnderTest = Get-Command New-DbaXESmartQueryExec } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have Query as a parameter" { - $CommandUnderTest | Should -HaveParameter Query -Type System.String + $CommandUnderTest | Should -HaveParameter Query } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have Event as a parameter" { - $CommandUnderTest | Should -HaveParameter Event -Type System.String[] + $CommandUnderTest | Should -HaveParameter Event } It "Should have Filter as a parameter" { - $CommandUnderTest | Should -HaveParameter Filter -Type System.String + $CommandUnderTest | Should -HaveParameter Filter } } diff --git a/tests/New-DbaXESmartReplay.Tests.ps1 b/tests/New-DbaXESmartReplay.Tests.ps1 index 4e42cb5aba..de47beea7b 100644 --- a/tests/New-DbaXESmartReplay.Tests.ps1 +++ b/tests/New-DbaXESmartReplay.Tests.ps1 @@ -10,31 +10,31 @@ Describe "New-DbaXESmartReplay" { $CommandUnderTest = Get-Command New-DbaXESmartReplay } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Event parameter" { - $CommandUnderTest | Should -HaveParameter Event -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Event } It "Should have Filter parameter" { - $CommandUnderTest | Should -HaveParameter Filter -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Filter } It "Should have DelaySeconds parameter" { - $CommandUnderTest | Should -HaveParameter DelaySeconds -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DelaySeconds } It "Should have StopOnError parameter" { - $CommandUnderTest | Should -HaveParameter StopOnError -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter StopOnError } It "Should have ReplayIntervalSeconds parameter" { - $CommandUnderTest | Should -HaveParameter ReplayIntervalSeconds -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ReplayIntervalSeconds } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/New-DbaXESmartTableWriter.Tests.ps1 b/tests/New-DbaXESmartTableWriter.Tests.ps1 index e7d8c325db..06ca6788f5 100644 --- a/tests/New-DbaXESmartTableWriter.Tests.ps1 +++ b/tests/New-DbaXESmartTableWriter.Tests.ps1 @@ -11,35 +11,35 @@ Describe "New-DbaXESmartTableWriter" { BeforeAll { $CommandUnderTest = Get-Command New-DbaXESmartTableWriter } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have Table as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String -Mandatory:$false + It "Should have Table as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Table } It "Should have AutoCreateTargetTable as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter AutoCreateTargetTable -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AutoCreateTargetTable } - It "Should have UploadIntervalSeconds as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter UploadIntervalSeconds -Type System.Int32 -Mandatory:$false + It "Should have UploadIntervalSeconds as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter UploadIntervalSeconds } - It "Should have Event as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Event -Type System.String[] -Mandatory:$false + It "Should have Event as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Event } - It "Should have OutputColumn as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter OutputColumn -Type System.String[] -Mandatory:$false + It "Should have OutputColumn as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter OutputColumn } - It "Should have Filter as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Filter -Type System.String -Mandatory:$false + It "Should have Filter as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Filter } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/New-DbatoolsSupportPackage.Tests.ps1 b/tests/New-DbatoolsSupportPackage.Tests.ps1 index 1e5f1d7c08..2c22ac1077 100644 --- a/tests/New-DbatoolsSupportPackage.Tests.ps1 +++ b/tests/New-DbatoolsSupportPackage.Tests.ps1 @@ -10,23 +10,23 @@ Describe "New-DbatoolsSupportPackage" { BeforeAll { $CommandUnderTest = Get-Command New-DbatoolsSupportPackage } - It "Should have Path as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } - It "Should have Variables as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter Variables -Type System.String[] -Mandatory:$false + It "Should have Variables as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Variables } - It "Should have PassThru as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter PassThru -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have PassThru as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter PassThru } - It "Should have EnableException as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have EnableException as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter EnableException } - It "Should have WhatIf as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have WhatIf as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter WhatIf } - It "Should have Confirm as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have Confirm as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Confirm } } diff --git a/tests/Publish-DbaDacPackage.Tests.ps1 b/tests/Publish-DbaDacPackage.Tests.ps1 index 6efab4f609..d19641a5c1 100644 --- a/tests/Publish-DbaDacPackage.Tests.ps1 +++ b/tests/Publish-DbaDacPackage.Tests.ps1 @@ -6,46 +6,46 @@ Describe "Publish-DbaDacPackage" { $CommandUnderTest = Get-Command Publish-DbaDacPackage } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have PublishXml parameter" { - $CommandUnderTest | Should -HaveParameter PublishXml -Type System.String + $CommandUnderTest | Should -HaveParameter PublishXml } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ConnectionString parameter" { - $CommandUnderTest | Should -HaveParameter ConnectionString -Type System.String[] + $CommandUnderTest | Should -HaveParameter ConnectionString } It "Should have GenerateDeploymentReport parameter" { - $CommandUnderTest | Should -HaveParameter GenerateDeploymentReport -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter GenerateDeploymentReport } It "Should have ScriptOnly parameter" { - $CommandUnderTest | Should -HaveParameter ScriptOnly -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ScriptOnly } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String + $CommandUnderTest | Should -HaveParameter Type } It "Should have OutputPath parameter" { - $CommandUnderTest | Should -HaveParameter OutputPath -Type System.String + $CommandUnderTest | Should -HaveParameter OutputPath } It "Should have IncludeSqlCmdVars parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSqlCmdVars -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncludeSqlCmdVars } It "Should have DacOption parameter" { - $CommandUnderTest | Should -HaveParameter DacOption -Type Object + $CommandUnderTest | Should -HaveParameter DacOption } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have DacFxPath parameter" { - $CommandUnderTest | Should -HaveParameter DacFxPath -Type System.String + $CommandUnderTest | Should -HaveParameter DacFxPath } } diff --git a/tests/Read-DbaAuditFile.Tests.ps1 b/tests/Read-DbaAuditFile.Tests.ps1 index d9206c345b..562a069a20 100644 --- a/tests/Read-DbaAuditFile.Tests.ps1 +++ b/tests/Read-DbaAuditFile.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Read-DbaAuditFile" { $CommandUnderTest = Get-Command Read-DbaAuditFile } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have Raw as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Raw -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Raw } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Read-DbaBackupHeader.Tests.ps1 b/tests/Read-DbaBackupHeader.Tests.ps1 index 53cdf91367..86cf30a04c 100644 --- a/tests/Read-DbaBackupHeader.Tests.ps1 +++ b/tests/Read-DbaBackupHeader.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Read-DbaBackupHeader" { $CommandUnderTest = Get-Command Read-DbaBackupHeader } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Path } It "Should have Simple parameter" { - $CommandUnderTest | Should -HaveParameter Simple -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Simple } It "Should have FileList parameter" { - $CommandUnderTest | Should -HaveParameter FileList -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter FileList } It "Should have AzureCredential parameter" { - $CommandUnderTest | Should -HaveParameter AzureCredential -Type System.String + $CommandUnderTest | Should -HaveParameter AzureCredential } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Read-DbaTraceFile.Tests.ps1 b/tests/Read-DbaTraceFile.Tests.ps1 index 1e34b4ba99..ccbed4c719 100644 --- a/tests/Read-DbaTraceFile.Tests.ps1 +++ b/tests/Read-DbaTraceFile.Tests.ps1 @@ -23,49 +23,49 @@ Describe "Read-DbaTraceFile" { $CommandUnderTest = Get-Command Read-DbaTraceFile } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String[] + $CommandUnderTest | Should -HaveParameter Path } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Login parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String[] + $CommandUnderTest | Should -HaveParameter Login } It "Should have Spid parameter" { - $CommandUnderTest | Should -HaveParameter Spid -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter Spid } It "Should have EventClass parameter" { - $CommandUnderTest | Should -HaveParameter EventClass -Type System.String[] + $CommandUnderTest | Should -HaveParameter EventClass } It "Should have ObjectType parameter" { - $CommandUnderTest | Should -HaveParameter ObjectType -Type System.String[] + $CommandUnderTest | Should -HaveParameter ObjectType } It "Should have ErrorId parameter" { - $CommandUnderTest | Should -HaveParameter ErrorId -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter ErrorId } It "Should have EventSequence parameter" { - $CommandUnderTest | Should -HaveParameter EventSequence -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter EventSequence } It "Should have TextData parameter" { - $CommandUnderTest | Should -HaveParameter TextData -Type System.String[] + $CommandUnderTest | Should -HaveParameter TextData } It "Should have ApplicationName parameter" { - $CommandUnderTest | Should -HaveParameter ApplicationName -Type System.String[] + $CommandUnderTest | Should -HaveParameter ApplicationName } It "Should have ObjectName parameter" { - $CommandUnderTest | Should -HaveParameter ObjectName -Type System.String[] + $CommandUnderTest | Should -HaveParameter ObjectName } It "Should have Where parameter" { - $CommandUnderTest | Should -HaveParameter Where -Type System.String + $CommandUnderTest | Should -HaveParameter Where } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Read-DbaTransactionLog.Tests.ps1 b/tests/Read-DbaTransactionLog.Tests.ps1 index 1b29e2de17..10b5ea6b0f 100644 --- a/tests/Read-DbaTransactionLog.Tests.ps1 +++ b/tests/Read-DbaTransactionLog.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Read-DbaTransactionLog" { $CommandUnderTest = Get-Command Read-DbaTransactionLog } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object + $CommandUnderTest | Should -HaveParameter Database } It "Should have IgnoreLimit parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreLimit -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IgnoreLimit } It "Should have RowLimit parameter" { - $CommandUnderTest | Should -HaveParameter RowLimit -Type System.Int32 + $CommandUnderTest | Should -HaveParameter RowLimit } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Read-DbaXEFile.Tests.ps1 b/tests/Read-DbaXEFile.Tests.ps1 index ecc1e01cb3..4e0d258ac1 100644 --- a/tests/Read-DbaXEFile.Tests.ps1 +++ b/tests/Read-DbaXEFile.Tests.ps1 @@ -13,13 +13,13 @@ Describe "Read-DbaXEFile" { $CommandUnderTest = Get-Command Read-DbaXEFile } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have Raw as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Raw -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Raw } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Register-DbatoolsConfig.Tests.ps1 b/tests/Register-DbatoolsConfig.Tests.ps1 index 23a9070986..038911247f 100644 --- a/tests/Register-DbatoolsConfig.Tests.ps1 +++ b/tests/Register-DbatoolsConfig.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Register-DbatoolsConfig" { $CommandUnderTest = Get-Command Register-DbatoolsConfig } It "Accepts Config as a parameter" { - $CommandUnderTest | Should -HaveParameter Config -Type Dataplat.Dbatools.Configuration.Config[] + $CommandUnderTest | Should -HaveParameter Config } It "Accepts FullName as a parameter" { - $CommandUnderTest | Should -HaveParameter FullName -Type System.String[] + $CommandUnderTest | Should -HaveParameter FullName } It "Accepts Module as a parameter" { - $CommandUnderTest | Should -HaveParameter Module -Type System.String + $CommandUnderTest | Should -HaveParameter Module } It "Accepts Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String + $CommandUnderTest | Should -HaveParameter Name } It "Accepts Scope as a parameter" { - $CommandUnderTest | Should -HaveParameter Scope -Type Dataplat.Dbatools.Configuration.ConfigScope + $CommandUnderTest | Should -HaveParameter Scope } It "Accepts EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaAgDatabase.Tests.ps1 b/tests/Remove-DbaAgDatabase.Tests.ps1 index d70b4d452c..a9479b68d3 100644 --- a/tests/Remove-DbaAgDatabase.Tests.ps1 +++ b/tests/Remove-DbaAgDatabase.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaAgDatabase" { $CommandUnderTest = Get-Command Remove-DbaAgDatabase } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Remove-DbaAgListener.Tests.ps1 b/tests/Remove-DbaAgListener.Tests.ps1 index 19af78ce12..880c20b0d6 100644 --- a/tests/Remove-DbaAgListener.Tests.ps1 +++ b/tests/Remove-DbaAgListener.Tests.ps1 @@ -5,22 +5,22 @@ Describe "Remove-DbaAgListener" { $CommandUnderTest = Get-Command Remove-DbaAgListener } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.SqlServer.Management.Smo.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Listener as a parameter" { - $CommandUnderTest | Should -HaveParameter Listener -Type System.String[] + $CommandUnderTest | Should -HaveParameter Listener } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String[] + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityGroupListener[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaAgReplica.Tests.ps1 b/tests/Remove-DbaAgReplica.Tests.ps1 index 0693d0fb8d..baa1e9da4c 100644 --- a/tests/Remove-DbaAgReplica.Tests.ps1 +++ b/tests/Remove-DbaAgReplica.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Remove-DbaAgReplica" { $CommandUnderTest = Get-Command Remove-DbaAgReplica } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String[] + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have Replica as a parameter" { - $CommandUnderTest | Should -HaveParameter Replica -Type System.String[] + $CommandUnderTest | Should -HaveParameter Replica } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityReplica[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter Confirm } } diff --git a/tests/Remove-DbaAgentAlert.Tests.ps1 b/tests/Remove-DbaAgentAlert.Tests.ps1 index 4b66cb3129..cbb8004ada 100644 --- a/tests/Remove-DbaAgentAlert.Tests.ps1 +++ b/tests/Remove-DbaAgentAlert.Tests.ps1 @@ -10,22 +10,22 @@ Describe "Remove-DbaAgentAlert Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Remove-DbaAgentAlert } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Alert parameter" { - $CommandUnderTest | Should -HaveParameter Alert -Type Microsoft.SqlServer.Management.Smo.Alert[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Alert } It "Should have ExcludeAlert parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeAlert -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeAlert } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Alert[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Remove-DbaAgentAlertCategory.Tests.ps1 b/tests/Remove-DbaAgentAlertCategory.Tests.ps1 index 966a551ccd..d881ea3ab8 100644 --- a/tests/Remove-DbaAgentAlertCategory.Tests.ps1 +++ b/tests/Remove-DbaAgentAlertCategory.Tests.ps1 @@ -5,20 +5,20 @@ Describe "Remove-DbaAgentAlertCategory" { BeforeAll { $CommandUnderTest = Get-Command Remove-DbaAgentAlertCategory } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Category as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Category -Type System.String[] -Mandatory:$false + It "Should have Category as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Category } - It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Agent.AlertCategory[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Agent.AlertCategory[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaAgentJob.Tests.ps1 b/tests/Remove-DbaAgentJob.Tests.ps1 index 5923df8596..f28b834ce7 100644 --- a/tests/Remove-DbaAgentJob.Tests.ps1 +++ b/tests/Remove-DbaAgentJob.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Remove-DbaAgentJob Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Remove-DbaAgentJob } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Job as a parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Job } It "Should have KeepHistory as a switch parameter" { - $CommandUnderTest | Should -HaveParameter KeepHistory -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter KeepHistory } It "Should have KeepUnusedSchedule as a switch parameter" { - $CommandUnderTest | Should -HaveParameter KeepUnusedSchedule -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter KeepUnusedSchedule } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Agent.Job[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Remove-DbaAgentJobCategory.Tests.ps1 b/tests/Remove-DbaAgentJobCategory.Tests.ps1 index 775ee2a110..f847cce6bd 100644 --- a/tests/Remove-DbaAgentJobCategory.Tests.ps1 +++ b/tests/Remove-DbaAgentJobCategory.Tests.ps1 @@ -5,23 +5,23 @@ Describe "Remove-DbaAgentJobCategory" { BeforeAll { $CommandUnderTest = Get-Command Remove-DbaAgentJobCategory } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Category as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Category -Type System.String[] -Mandatory:$false + It "Should have Category as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Category } - It "Should have CategoryType as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter CategoryType -Type System.String[] -Mandatory:$false + It "Should have CategoryType as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter CategoryType } - It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Agent.JobCategory[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Agent.JobCategory[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Remove-DbaAgentJobStep.Tests.ps1 b/tests/Remove-DbaAgentJobStep.Tests.ps1 index 66ca9e67d1..531241f419 100644 --- a/tests/Remove-DbaAgentJobStep.Tests.ps1 +++ b/tests/Remove-DbaAgentJobStep.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Remove-DbaAgentJobStep" { $CommandUnderTest = Get-Command Remove-DbaAgentJobStep } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Job as a parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Job } It "Should have StepName as a parameter" { - $CommandUnderTest | Should -HaveParameter StepName -Type System.String + $CommandUnderTest | Should -HaveParameter StepName } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Confirm } } } diff --git a/tests/Remove-DbaAgentOperator.Tests.ps1 b/tests/Remove-DbaAgentOperator.Tests.ps1 index a7eeb050e6..2b3d3d499e 100644 --- a/tests/Remove-DbaAgentOperator.Tests.ps1 +++ b/tests/Remove-DbaAgentOperator.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Remove-DbaAgentOperator" { $CommandUnderTest = Get-Command Remove-DbaAgentOperator } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Operator as a parameter" { - $CommandUnderTest | Should -HaveParameter Operator -Type System.String[] + $CommandUnderTest | Should -HaveParameter Operator } It "Should have ExcludeOperator as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeOperator -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeOperator } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Agent.Operator[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Confirm } } } @@ -41,13 +41,13 @@ Describe "Remove-DbaAgentOperator Integration Tests" -Tag "IntegrationTests" { } AfterAll { - $null = Remove-DbaAgentOperator -SqlInstance $instance2 -Operator $email1 -Confirm:$false - $null = Remove-DbaAgentOperator -SqlInstance $instance2 -Operator $email2 -Confirm:$false + $null = Remove-DbaAgentOperator -SqlInstance $instance2 -Operator $email1 + $null = Remove-DbaAgentOperator -SqlInstance $instance2 -Operator $email2 } Context "Remove Agent Operator is removed properly" { It "Should have no operator with that name" { - Remove-DbaAgentOperator -SqlInstance $instance2 -Operator $email1 -Confirm:$false + Remove-DbaAgentOperator -SqlInstance $instance2 -Operator $email1 $results = (Get-DbaAgentOperator -SqlInstance $instance2 -Operator $email1).Count $results | Should -Be 0 } @@ -56,7 +56,7 @@ Describe "Remove-DbaAgentOperator Integration Tests" -Tag "IntegrationTests" { $operatorName = "dbatoolsci_test_$(Get-Random)" $null = New-DbaAgentOperator -SqlInstance $instance2 -Operator $operatorName (Get-DbaAgentOperator -SqlInstance $instance2 -Operator $operatorName) | Should -Not -BeNullOrEmpty - Get-DbaAgentOperator -SqlInstance $instance2 -Operator $operatorName | Remove-DbaAgentOperator -Confirm:$false + Get-DbaAgentOperator -SqlInstance $instance2 -Operator $operatorName | Remove-DbaAgentOperator (Get-DbaAgentOperator -SqlInstance $instance2 -Operator $operatorName) | Should -BeNullOrEmpty } } diff --git a/tests/Remove-DbaAgentProxy.Tests.ps1 b/tests/Remove-DbaAgentProxy.Tests.ps1 index 97799ee774..a847912af9 100644 --- a/tests/Remove-DbaAgentProxy.Tests.ps1 +++ b/tests/Remove-DbaAgentProxy.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaAgentProxy" { $CommandUnderTest = Get-Command Remove-DbaAgentProxy } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Proxy as a parameter" { - $CommandUnderTest | Should -HaveParameter Proxy -Type System.String[] + $CommandUnderTest | Should -HaveParameter Proxy } It "Should have ExcludeProxy as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeProxy -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeProxy } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.ProxyAccount[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaAgentSchedule.Tests.ps1 b/tests/Remove-DbaAgentSchedule.Tests.ps1 index d02ba7334c..576edfc211 100644 --- a/tests/Remove-DbaAgentSchedule.Tests.ps1 +++ b/tests/Remove-DbaAgentSchedule.Tests.ps1 @@ -12,28 +12,28 @@ Describe "Remove-DbaAgentSchedule Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Remove-DbaAgentSchedule } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Schedule as a parameter" { - $CommandUnderTest | Should -HaveParameter Schedule -Type String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Schedule } It "Should have ScheduleUid as a parameter" { - $CommandUnderTest | Should -HaveParameter ScheduleUid -Type String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ScheduleUid } It "Should have Id as a parameter" { - $CommandUnderTest | Should -HaveParameter Id -Type Int32[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Id } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type ScheduleBase[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } } } diff --git a/tests/Remove-DbaAvailabilityGroup.Tests.ps1 b/tests/Remove-DbaAvailabilityGroup.Tests.ps1 index 9fa3abc1da..8565165435 100644 --- a/tests/Remove-DbaAvailabilityGroup.Tests.ps1 +++ b/tests/Remove-DbaAvailabilityGroup.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaAvailabilityGroup" { $CommandUnderTest = Get-Command Remove-DbaAvailabilityGroup } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String[] + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have AllAvailabilityGroups as a switch parameter" { - $CommandUnderTest | Should -HaveParameter AllAvailabilityGroups -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AllAvailabilityGroups } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityGroup[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaBackup.Tests.ps1 b/tests/Remove-DbaBackup.Tests.ps1 index a98569e6e2..d2397c200e 100644 --- a/tests/Remove-DbaBackup.Tests.ps1 +++ b/tests/Remove-DbaBackup.Tests.ps1 @@ -17,22 +17,22 @@ Describe "Remove-DbaBackup" { $CommandUnderTest = Get-Command Remove-DbaBackup } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have BackupFileExtension as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupFileExtension -Type System.String + $CommandUnderTest | Should -HaveParameter BackupFileExtension } It "Should have RetentionPeriod as a parameter" { - $CommandUnderTest | Should -HaveParameter RetentionPeriod -Type System.String + $CommandUnderTest | Should -HaveParameter RetentionPeriod } It "Should have CheckArchiveBit as a switch parameter" { - $CommandUnderTest | Should -HaveParameter CheckArchiveBit -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter CheckArchiveBit } It "Should have RemoveEmptyBackupFolder as a switch parameter" { - $CommandUnderTest | Should -HaveParameter RemoveEmptyBackupFolder -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter RemoveEmptyBackupFolder } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaClientAlias.Tests.ps1 b/tests/Remove-DbaClientAlias.Tests.ps1 index f97ffea78f..db204b26ce 100644 --- a/tests/Remove-DbaClientAlias.Tests.ps1 +++ b/tests/Remove-DbaClientAlias.Tests.ps1 @@ -19,16 +19,16 @@ Describe "Remove-DbaClientAlias" { $CommandUnderTest = Get-Command Remove-DbaClientAlias } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Alias as a parameter" { - $CommandUnderTest | Should -HaveParameter Alias -Type System.String[] + $CommandUnderTest | Should -HaveParameter Alias } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaCmConnection.Tests.ps1 b/tests/Remove-DbaCmConnection.Tests.ps1 index 7fdf87da6f..0fb80ec1e8 100644 --- a/tests/Remove-DbaCmConnection.Tests.ps1 +++ b/tests/Remove-DbaCmConnection.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Remove-DbaCmConnection" { $CommandUnderTest = Get-Command Remove-DbaCmConnection } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaCmConnectionParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Confirm } } } diff --git a/tests/Remove-DbaComputerCertificate.Tests.ps1 b/tests/Remove-DbaComputerCertificate.Tests.ps1 index c916f2db03..bf92def23e 100644 --- a/tests/Remove-DbaComputerCertificate.Tests.ps1 +++ b/tests/Remove-DbaComputerCertificate.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaComputerCertificate" { $CommandUnderTest = Get-Command Remove-DbaComputerCertificate } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Thumbprint as a parameter" { - $CommandUnderTest | Should -HaveParameter Thumbprint -Type System.String[] + $CommandUnderTest | Should -HaveParameter Thumbprint } It "Should have Store as a parameter" { - $CommandUnderTest | Should -HaveParameter Store -Type System.String + $CommandUnderTest | Should -HaveParameter Store } It "Should have Folder as a parameter" { - $CommandUnderTest | Should -HaveParameter Folder -Type System.String + $CommandUnderTest | Should -HaveParameter Folder } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaCredential.Tests.ps1 b/tests/Remove-DbaCredential.Tests.ps1 index d8d032eca2..034259b20c 100644 --- a/tests/Remove-DbaCredential.Tests.ps1 +++ b/tests/Remove-DbaCredential.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Remove-DbaCredential" { $CommandUnderTest = Get-Command Remove-DbaCredential } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.String[] + $CommandUnderTest | Should -HaveParameter Credential } It "Should have ExcludeCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeCredential -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeCredential } It "Should have Identity as a parameter" { - $CommandUnderTest | Should -HaveParameter Identity -Type System.String[] + $CommandUnderTest | Should -HaveParameter Identity } It "Should have ExcludeIdentity as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeIdentity -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeIdentity } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Credential[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaCustomError.Tests.ps1 b/tests/Remove-DbaCustomError.Tests.ps1 index e1d813d3db..4ae100a7c5 100644 --- a/tests/Remove-DbaCustomError.Tests.ps1 +++ b/tests/Remove-DbaCustomError.Tests.ps1 @@ -42,19 +42,19 @@ Describe "Remove-DbaCustomError" { $CommandUnderTest = Get-Command Remove-DbaCustomError } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have MessageID as a parameter" { - $CommandUnderTest | Should -HaveParameter MessageID -Type System.Int32 + $CommandUnderTest | Should -HaveParameter MessageID } It "Should have Language as a parameter" { - $CommandUnderTest | Should -HaveParameter Language -Type System.String + $CommandUnderTest | Should -HaveParameter Language } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDatabase.Tests.ps1 b/tests/Remove-DbaDatabase.Tests.ps1 index 1b1b8dd53e..85f14e57d8 100644 --- a/tests/Remove-DbaDatabase.Tests.ps1 +++ b/tests/Remove-DbaDatabase.Tests.ps1 @@ -10,19 +10,19 @@ Describe "Remove-DbaDatabase" { $CommandUnderTest = Get-Command Remove-DbaDatabase } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDatabaseSafely.Tests.ps1 b/tests/Remove-DbaDatabaseSafely.Tests.ps1 index 88773ef324..ea1a2e6513 100644 --- a/tests/Remove-DbaDatabaseSafely.Tests.ps1 +++ b/tests/Remove-DbaDatabaseSafely.Tests.ps1 @@ -11,47 +11,47 @@ Describe "Remove-DbaDatabaseSafely" { BeforeAll { $CommandUnderTest = Get-Command Remove-DbaDatabaseSafely } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have Destination as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter -Mandatory:$false + It "Should have Destination as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Destination } - It "Should have DestinationSqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have DestinationSqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have NoDbccCheckDb as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter NoDbccCheckDb -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoDbccCheckDb } - It "Should have BackupFolder as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter BackupFolder -Type System.String -Mandatory:$false + It "Should have BackupFolder as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter BackupFolder } - It "Should have CategoryName as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter CategoryName -Type System.String -Mandatory:$false + It "Should have CategoryName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter CategoryName } - It "Should have JobOwner as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter JobOwner -Type System.String -Mandatory:$false + It "Should have JobOwner as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter JobOwner } It "Should have AllDatabases as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter AllDatabases -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AllDatabases } - It "Should have BackupCompression as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter BackupCompression -Type System.String -Mandatory:$false + It "Should have BackupCompression as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter BackupCompression } It "Should have ReuseSourceFolderStructure as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ReuseSourceFolderStructure -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ReuseSourceFolderStructure } It "Should have Force as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDbAsymmetricKey.Tests.ps1 b/tests/Remove-DbaDbAsymmetricKey.Tests.ps1 index 0b172749c5..31251b3086 100644 --- a/tests/Remove-DbaDbAsymmetricKey.Tests.ps1 +++ b/tests/Remove-DbaDbAsymmetricKey.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaDbAsymmetricKey" { $CommandUnderTest = Get-Command Remove-DbaDbAsymmetricKey } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] + $CommandUnderTest | Should -HaveParameter Name } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AsymmetricKey[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -31,7 +31,7 @@ Describe "Remove-DbaDbAsymmetricKey" { $null = New-DbaDatabase -SqlInstance $global:instance2 -Name $database $keyname = 'test1' $tPassword = ConvertTo-SecureString "ThisIsThePassword1" -AsPlainText -Force - New-DbaDbMasterKey -SqlInstance $global:instance2 -Database $database -SecurePassword $tPassword -Confirm:$false + New-DbaDbMasterKey -SqlInstance $global:instance2 -Database $database -SecurePassword $tPassword $key = New-DbaDbAsymmetricKey -SqlInstance $global:instance2 -Name $keyname -Database $database } AfterAll { diff --git a/tests/Remove-DbaDbBackupRestoreHistory.Tests.ps1 b/tests/Remove-DbaDbBackupRestoreHistory.Tests.ps1 index 29bfa14f64..365135027b 100644 --- a/tests/Remove-DbaDbBackupRestoreHistory.Tests.ps1 +++ b/tests/Remove-DbaDbBackupRestoreHistory.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaDbBackupRestoreHistory" { $CommandUnderTest = Get-Command Remove-DbaDbBackupRestoreHistory } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have KeepDays as a parameter" { - $CommandUnderTest | Should -HaveParameter KeepDays -Type System.Int32 + $CommandUnderTest | Should -HaveParameter KeepDays } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDbCertificate.Tests.ps1 b/tests/Remove-DbaDbCertificate.Tests.ps1 index 019e007652..601ba731b0 100644 --- a/tests/Remove-DbaDbCertificate.Tests.ps1 +++ b/tests/Remove-DbaDbCertificate.Tests.ps1 @@ -13,27 +13,27 @@ Describe "Remove-DbaDbCertificate Unit Tests" -Tag 'UnitTests' { } It "Should have SqlInstance parameter" { - $command | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $command | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $command | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $command | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $command | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $command | Should -HaveParameter Database } It "Should have Certificate parameter" { - $command | Should -HaveParameter Certificate -Type System.String[] -Mandatory:$false + $command | Should -HaveParameter Certificate } It "Should have InputObject parameter" { - $command | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Certificate[] -Mandatory:$false + $command | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $command | Should -HaveParameter EnableException } } } diff --git a/tests/Remove-DbaDbCheckConstraint.Tests.ps1 b/tests/Remove-DbaDbCheckConstraint.Tests.ps1 index 15ef5191cf..826094f801 100644 --- a/tests/Remove-DbaDbCheckConstraint.Tests.ps1 +++ b/tests/Remove-DbaDbCheckConstraint.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Remove-DbaDbCheckConstraint" { $CommandUnderTest = Get-Command Remove-DbaDbCheckConstraint } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have ExcludeSystemTable as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemTable -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeSystemTable } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Check[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDbData.Tests.ps1 b/tests/Remove-DbaDbData.Tests.ps1 index b48decb1b1..73b2494971 100644 --- a/tests/Remove-DbaDbData.Tests.ps1 +++ b/tests/Remove-DbaDbData.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Remove-DbaDbData" { $CommandUnderTest = Get-Command Remove-DbaDbData } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String + $CommandUnderTest | Should -HaveParameter Path } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDbEncryptionKey.Tests.ps1 b/tests/Remove-DbaDbEncryptionKey.Tests.ps1 index ad9fa432fb..24d68997f6 100644 --- a/tests/Remove-DbaDbEncryptionKey.Tests.ps1 +++ b/tests/Remove-DbaDbEncryptionKey.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Remove-DbaDbEncryptionKey" { $CommandUnderTest = Get-Command Remove-DbaDbEncryptionKey } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.DatabaseEncryptionKey[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDbFileGroup.Tests.ps1 b/tests/Remove-DbaDbFileGroup.Tests.ps1 index ee9921d207..0800e24f78 100644 --- a/tests/Remove-DbaDbFileGroup.Tests.ps1 +++ b/tests/Remove-DbaDbFileGroup.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaDbFileGroup Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Remove-DbaDbFileGroup } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have FileGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter FileGroup -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FileGroup } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Remove-DbaDbLogShipping.Tests.ps1 b/tests/Remove-DbaDbLogShipping.Tests.ps1 index ce803682c1..af95433b6f 100644 --- a/tests/Remove-DbaDbLogShipping.Tests.ps1 +++ b/tests/Remove-DbaDbLogShipping.Tests.ps1 @@ -9,25 +9,25 @@ Describe "Remove-DbaDbLogShipping Unit Tests" -Tag "UnitTests" { $CommandUnderTest = Get-Command Remove-DbaDbLogShipping } It "Should have PrimarySqlInstance as a non-mandatory Dataplat.Dbatools.Parameter.DbaInstanceParameter" { - $CommandUnderTest | Should -HaveParameter PrimarySqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PrimarySqlInstance } It "Should have SecondarySqlInstance as a non-mandatory Dataplat.Dbatools.Parameter.DbaInstanceParameter" { - $CommandUnderTest | Should -HaveParameter SecondarySqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SecondarySqlInstance } It "Should have PrimarySqlCredential as a non-mandatory System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter PrimarySqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PrimarySqlCredential } It "Should have SecondarySqlCredential as a non-mandatory System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SecondarySqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SecondarySqlCredential } It "Should have Database as a non-mandatory System.Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have RemoveSecondaryDatabase as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter RemoveSecondaryDatabase -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter RemoveSecondaryDatabase } It "Should have EnableException as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Remove-DbaDbMailAccount.Tests.ps1 b/tests/Remove-DbaDbMailAccount.Tests.ps1 index fe67be5551..9f4969ec11 100644 --- a/tests/Remove-DbaDbMailAccount.Tests.ps1 +++ b/tests/Remove-DbaDbMailAccount.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Remove-DbaDbMailAccount" { $CommandUnderTest = Get-Command Remove-DbaDbMailAccount } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Account as a parameter" { - $CommandUnderTest | Should -HaveParameter Account -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Account } It "Should have ExcludeAccount as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeAccount -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeAccount } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type MailAccount[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDbMailProfile.Tests.ps1 b/tests/Remove-DbaDbMailProfile.Tests.ps1 index dc03dd8780..83a4f968cb 100644 --- a/tests/Remove-DbaDbMailProfile.Tests.ps1 +++ b/tests/Remove-DbaDbMailProfile.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaDbMailProfile" { $CommandUnderTest = Get-Command Remove-DbaDbMailProfile } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Profile as a parameter" { - $CommandUnderTest | Should -HaveParameter Profile -Type System.String[] + $CommandUnderTest | Should -HaveParameter Profile } It "Should have ExcludeProfile as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeProfile -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeProfile } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Mail.MailProfile[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDbMasterKey.Tests.ps1 b/tests/Remove-DbaDbMasterKey.Tests.ps1 index 33226ad715..dc6cc3629b 100644 --- a/tests/Remove-DbaDbMasterKey.Tests.ps1 +++ b/tests/Remove-DbaDbMasterKey.Tests.ps1 @@ -13,31 +13,31 @@ Describe "Remove-DbaDbMasterKey Unit Tests" -Tag 'UnitTests' { } It "Should have SqlInstance parameter" { - $command | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] -Mandatory:$false + $command | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $command | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $command | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $command | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $command | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $command | Should -HaveParameter ExcludeDatabase -Type System.String[] -Mandatory:$false + $command | Should -HaveParameter ExcludeDatabase } It "Should have All parameter" { - $command | Should -HaveParameter All -Type System.Management.Automation.Switch -Mandatory:$false + $command | Should -HaveParameter All } It "Should have InputObject parameter" { - $command | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.MasterKey[] -Mandatory:$false + $command | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $command | Should -HaveParameter EnableException } } } diff --git a/tests/Remove-DbaDbMirror.Tests.ps1 b/tests/Remove-DbaDbMirror.Tests.ps1 index 4b101810db..a35167ba36 100644 --- a/tests/Remove-DbaDbMirror.Tests.ps1 +++ b/tests/Remove-DbaDbMirror.Tests.ps1 @@ -10,25 +10,25 @@ Describe "Remove-DbaDbMirror" { $CommandUnderTest = Get-Command Remove-DbaDbMirror } It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Confirm } } } diff --git a/tests/Remove-DbaDbMirrorMonitor.Tests.ps1 b/tests/Remove-DbaDbMirrorMonitor.Tests.ps1 index e4d34a9d4c..60af1c0a39 100644 --- a/tests/Remove-DbaDbMirrorMonitor.Tests.ps1 +++ b/tests/Remove-DbaDbMirrorMonitor.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Remove-DbaDbMirrorMonitor" { $CommandUnderTest = Get-Command Remove-DbaDbMirrorMonitor } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDbOrphanUser.Tests.ps1 b/tests/Remove-DbaDbOrphanUser.Tests.ps1 index f1d7f5685c..22cf3defd5 100644 --- a/tests/Remove-DbaDbOrphanUser.Tests.ps1 +++ b/tests/Remove-DbaDbOrphanUser.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Remove-DbaDbOrphanUser Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Remove-DbaDbOrphanUser } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have User as a parameter" { - $CommandUnderTest | Should -HaveParameter User -Type System.Object[] + $CommandUnderTest | Should -HaveParameter User } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Remove-DbaDbPartitionFunction.Tests.ps1 b/tests/Remove-DbaDbPartitionFunction.Tests.ps1 index b54e860041..ac341c51cc 100644 --- a/tests/Remove-DbaDbPartitionFunction.Tests.ps1 +++ b/tests/Remove-DbaDbPartitionFunction.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaDbPartitionFunction" { $CommandUnderTest = Get-Command Remove-DbaDbPartitionFunction } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type PartitionFunction[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDbPartitionScheme.Tests.ps1 b/tests/Remove-DbaDbPartitionScheme.Tests.ps1 index 482263cec2..f80314f5bf 100644 --- a/tests/Remove-DbaDbPartitionScheme.Tests.ps1 +++ b/tests/Remove-DbaDbPartitionScheme.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Remove-DbaDbPartitionScheme" { $CommandUnderTest = Get-Command Remove-DbaDbPartitionScheme } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.PartitionScheme[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Confirm } } } diff --git a/tests/Remove-DbaDbRole.Tests.ps1 b/tests/Remove-DbaDbRole.Tests.ps1 index ffeb155bf4..9c5db40c97 100644 --- a/tests/Remove-DbaDbRole.Tests.ps1 +++ b/tests/Remove-DbaDbRole.Tests.ps1 @@ -6,31 +6,31 @@ Describe "Remove-DbaDbRole Unit Tests" -Tag "UnitTests" { $CommandUnderTest = Get-Command Remove-DbaDbRole } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Role parameter" { - $CommandUnderTest | Should -HaveParameter Role -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Role } It "Should have ExcludeRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeRole -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeRole } It "Should have IncludeSystemDbs parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemDbs -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeSystemDbs } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Remove-DbaDbRoleMember.Tests.ps1 b/tests/Remove-DbaDbRoleMember.Tests.ps1 index b7d68a9daa..ed3ff22eac 100644 --- a/tests/Remove-DbaDbRoleMember.Tests.ps1 +++ b/tests/Remove-DbaDbRoleMember.Tests.ps1 @@ -31,8 +31,8 @@ Describe "Remove-DbaDbRoleMember" { $server = Connect-DbaInstance -SqlInstance $global:instance2 $null = $server.Query("DROP USER User1", 'msdb') $null = $server.Query("DROP USER User2", 'msdb') - $null = Remove-DbaDatabase -SqlInstance $global:instance2 -Database $dbname -Confirm:$false - $null = Remove-DbaLogin -SqlInstance $global:instance2 -Login $user1, $user2 -Confirm:$false + $null = Remove-DbaDatabase -SqlInstance $global:instance2 -Database $dbname + $null = Remove-DbaLogin -SqlInstance $global:instance2 -Login $user1, $user2 } Context "Validate parameters" { @@ -40,25 +40,25 @@ Describe "Remove-DbaDbRoleMember" { $CommandUnderTest = Get-Command Remove-DbaDbRoleMember } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Role as a parameter" { - $CommandUnderTest | Should -HaveParameter Role -Type System.String[] + $CommandUnderTest | Should -HaveParameter Role } It "Should have User as a parameter" { - $CommandUnderTest | Should -HaveParameter User -Type System.String[] + $CommandUnderTest | Should -HaveParameter User } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -69,7 +69,7 @@ Describe "Remove-DbaDbRoleMember" { It 'Removes Role for User' { $roleDB = Get-DbaDbRoleMember -SqlInstance $global:instance2 -Database $dbname -Role $role - Remove-DbaDbRoleMember -SqlInstance $global:instance2 -Role $role -User 'User1' -Database $dbname -Confirm:$false + Remove-DbaDbRoleMember -SqlInstance $global:instance2 -Role $role -User 'User1' -Database $dbname $roleDBAfter = Get-DbaDbRoleMember -SqlInstance $server -Database $dbname -Role $role $roleDB.UserName | Should -Be 'User1' @@ -78,7 +78,7 @@ Describe "Remove-DbaDbRoleMember" { It 'Removes Multiple Roles for User' { $roleDB = Get-DbaDbRoleMember -SqlInstance $server -Database msdb -Role db_datareader, SQLAgentReaderRole - $server | Remove-DbaDbRoleMember -Role db_datareader, SQLAgentReaderRole -User 'User1' -Database msdb -Confirm:$false + $server | Remove-DbaDbRoleMember -Role db_datareader, SQLAgentReaderRole -User 'User1' -Database msdb $roleDBAfter = Get-DbaDbRoleMember -SqlInstance $server -Database msdb -Role db_datareader, SQLAgentReaderRole $roleDB.UserName | Should -Contain 'User1' @@ -91,7 +91,7 @@ Describe "Remove-DbaDbRoleMember" { It 'Removes Roles for User via piped input from Get-DbaDbRole' { $roleInput = Get-DbaDbRole -SqlInstance $server -Database msdb -Role db_datareader, SQLAgentReaderRole $roleDB = Get-DbaDbRoleMember -SqlInstance $server -Database msdb -Role db_datareader, SQLAgentReaderRole - $roleInput | Remove-DbaDbRoleMember -User 'User2' -Confirm:$false + $roleInput | Remove-DbaDbRoleMember -User 'User2' $roleDBAfter = Get-DbaDbRoleMember -SqlInstance $server -Database msdb -Role db_datareader, SQLAgentReaderRole $roleDB.UserName | Should -Contain 'User2' diff --git a/tests/Remove-DbaDbSchema.Tests.ps1 b/tests/Remove-DbaDbSchema.Tests.ps1 index c37736c7ce..a5f7da9ff9 100644 --- a/tests/Remove-DbaDbSchema.Tests.ps1 +++ b/tests/Remove-DbaDbSchema.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaDbSchema" { $CommandUnderTest = Get-Command Remove-DbaDbSchema } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Schema } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDbSequence.Tests.ps1 b/tests/Remove-DbaDbSequence.Tests.ps1 index d0a1492c74..ecad8f7e75 100644 --- a/tests/Remove-DbaDbSequence.Tests.ps1 +++ b/tests/Remove-DbaDbSequence.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Remove-DbaDbSequence" { $CommandUnderTest = Get-Command Remove-DbaDbSequence } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Sequence as a parameter" { - $CommandUnderTest | Should -HaveParameter Sequence -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Sequence } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Schema } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Sequence[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDbSnapshot.Tests.ps1 b/tests/Remove-DbaDbSnapshot.Tests.ps1 index 4791846710..4295848d41 100644 --- a/tests/Remove-DbaDbSnapshot.Tests.ps1 +++ b/tests/Remove-DbaDbSnapshot.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Remove-DbaDbSnapshot" { $CommandUnderTest = Get-Command Remove-DbaDbSnapshot } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Snapshot parameter" { - $CommandUnderTest | Should -HaveParameter Snapshot -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Snapshot } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have AllSnapshots parameter" { - $CommandUnderTest | Should -HaveParameter AllSnapshots -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AllSnapshots } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDbSynonym.Tests.ps1 b/tests/Remove-DbaDbSynonym.Tests.ps1 index 1ab797c26d..593bec7070 100644 --- a/tests/Remove-DbaDbSynonym.Tests.ps1 +++ b/tests/Remove-DbaDbSynonym.Tests.ps1 @@ -22,34 +22,34 @@ Describe "Remove-DbaDbSynonym" { $CommandUnderTest = Get-Command Remove-DbaDbSynonym } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String[] + $CommandUnderTest | Should -HaveParameter Schema } It "Should have ExcludeSchema as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSchema -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeSchema } It "Should have Synonym as a parameter" { - $CommandUnderTest | Should -HaveParameter Synonym -Type System.String[] + $CommandUnderTest | Should -HaveParameter Synonym } It "Should have ExcludeSynonym as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSynonym -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeSynonym } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDbTable.Tests.ps1 b/tests/Remove-DbaDbTable.Tests.ps1 index c0f341274b..679e3a96ec 100644 --- a/tests/Remove-DbaDbTable.Tests.ps1 +++ b/tests/Remove-DbaDbTable.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaDbTable" { $CommandUnderTest = Get-Command Remove-DbaDbTable } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Table as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Table } It "Should have InputObject as a non-mandatory parameter of type [Microsoft.SqlServer.Management.Smo.Table[]]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type [Microsoft.SqlServer.Management.Smo.Table[]] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDbTableData.Tests.ps1 b/tests/Remove-DbaDbTableData.Tests.ps1 index ee9c8bf724..92d706d259 100644 --- a/tests/Remove-DbaDbTableData.Tests.ps1 +++ b/tests/Remove-DbaDbTableData.Tests.ps1 @@ -53,41 +53,41 @@ Describe "Remove-DbaDbTableData" { BeforeAll { $CommandUnderTest = Get-Command Remove-DbaDbTableData } - It "Should have SqlInstance as a DbaInstanceParameter[] parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a DbaInstanceParameter[] parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] } - It "Should have SqlCredential as a PSCredential parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.SqlServer.Management.Smo.PSCredential -Mandatory:$false + It "Should have SqlCredential as a PSCredential parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.SqlServer.Management.Smo.PSCredential } - It "Should have Database as a String[] parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + It "Should have Database as a String[] parameter" { + $CommandUnderTest | Should -HaveParameter Database -Type System.String[] } - It "Should have BatchSize as an Int32 parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter BatchSize -Type System.Int32 -Mandatory:$false + It "Should have BatchSize as an Int32 parameter" { + $CommandUnderTest | Should -HaveParameter BatchSize -Type System.Int32 } - It "Should have Table as a String parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String -Mandatory:$false + It "Should have Table as a String parameter" { + $CommandUnderTest | Should -HaveParameter Table -Type System.String } - It "Should have DeleteSql as a String parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter DeleteSql -Type System.String -Mandatory:$false + It "Should have DeleteSql as a String parameter" { + $CommandUnderTest | Should -HaveParameter DeleteSql -Type System.String } - It "Should have LogBackupPath as a String parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter LogBackupPath -Type System.String -Mandatory:$false + It "Should have LogBackupPath as a String parameter" { + $CommandUnderTest | Should -HaveParameter LogBackupPath -Type System.String } - It "Should have LogBackupTimeStampFormat as a String parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter LogBackupTimeStampFormat -Type System.String -Mandatory:$false + It "Should have LogBackupTimeStampFormat as a String parameter" { + $CommandUnderTest | Should -HaveParameter LogBackupTimeStampFormat -Type System.String } - It "Should have AzureBaseUrl as a String[] parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter AzureBaseUrl -Type System.String[] -Mandatory:$false + It "Should have AzureBaseUrl as a String[] parameter" { + $CommandUnderTest | Should -HaveParameter AzureBaseUrl -Type System.String[] } - It "Should have AzureCredential as a String parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter AzureCredential -Type System.String -Mandatory:$false + It "Should have AzureCredential as a String parameter" { + $CommandUnderTest | Should -HaveParameter AzureCredential -Type System.String } - It "Should have InputObject as an Object[] parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + It "Should have InputObject as an Object[] parameter" { + $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] } - It "Should have EnableException as a Switch that is not mandatory" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have EnableException as a Switch" { + $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch } } diff --git a/tests/Remove-DbaDbUdf.Tests.ps1 b/tests/Remove-DbaDbUdf.Tests.ps1 index b2c058eaed..4fe1cc8422 100644 --- a/tests/Remove-DbaDbUdf.Tests.ps1 +++ b/tests/Remove-DbaDbUdf.Tests.ps1 @@ -5,38 +5,38 @@ Describe "Remove-DbaDbUdf" { BeforeAll { $CommandUnderTest = Get-Command Remove-DbaDbUdf } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have ExcludeDatabase as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false + It "Should have ExcludeDatabase as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have ExcludeSystemUdf as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemUdf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeSystemUdf } - It "Should have Schema as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Mandatory:$false + It "Should have Schema as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Schema } - It "Should have ExcludeSchema as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeSchema -Type String[] -Mandatory:$false + It "Should have ExcludeSchema as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeSchema } - It "Should have Name as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Name -Type String[] -Mandatory:$false + It "Should have Name as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Name } - It "Should have ExcludeName as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeName -Type String[] -Mandatory:$false + It "Should have ExcludeName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeName } - It "Should have InputObject as a non-mandatory parameter of type UserDefinedFunction[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.UserDefinedFunction[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaDbUser.Tests.ps1 b/tests/Remove-DbaDbUser.Tests.ps1 index 5f08ee04e1..9dae07792a 100644 --- a/tests/Remove-DbaDbUser.Tests.ps1 +++ b/tests/Remove-DbaDbUser.Tests.ps1 @@ -12,28 +12,28 @@ Describe "Remove-DbaDbUser Unit Tests" -Tag 'UnitTests' { $command = Get-Command -Name $CommandName } It "Should have SqlInstance parameter" { - $command | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] -Mandatory:$false + $command | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $command | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $command | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $command | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $command | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $command | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $command | Should -HaveParameter ExcludeDatabase } It "Should have User parameter" { - $command | Should -HaveParameter User -Type System.Object[] -Mandatory:$false + $command | Should -HaveParameter User } It "Should have InputObject parameter" { - $command | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.SMO.User[] -Mandatory:$false + $command | Should -HaveParameter InputObject } It "Should have Force parameter" { - $command | Should -HaveParameter Force -Type System.Management.Automation.Switch -Mandatory:$false + $command | Should -HaveParameter Force } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $command | Should -HaveParameter EnableException } } } diff --git a/tests/Remove-DbaDbView.Tests.ps1 b/tests/Remove-DbaDbView.Tests.ps1 index 3c95a701f6..e7fb7142f9 100644 --- a/tests/Remove-DbaDbView.Tests.ps1 +++ b/tests/Remove-DbaDbView.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaDbView" { $CommandUnderTest = Get-Command Remove-DbaDbView } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have View as a parameter" { - $CommandUnderTest | Should -HaveParameter View -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter View } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.View[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaEndpoint.Tests.ps1 b/tests/Remove-DbaEndpoint.Tests.ps1 index c3c248603f..7a78fc8c90 100644 --- a/tests/Remove-DbaEndpoint.Tests.ps1 +++ b/tests/Remove-DbaEndpoint.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaEndpoint" { $CommandUnderTest = Get-Command Remove-DbaEndpoint } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Endpoint as a parameter" { - $CommandUnderTest | Should -HaveParameter Endpoint -Type System.String[] + $CommandUnderTest | Should -HaveParameter Endpoint } It "Should have AllEndpoints as a switch parameter" { - $CommandUnderTest | Should -HaveParameter AllEndpoints -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AllEndpoints } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Endpoint[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaExtendedProperty.Tests.ps1 b/tests/Remove-DbaExtendedProperty.Tests.ps1 index b5745ed6bd..80b65e347d 100644 --- a/tests/Remove-DbaExtendedProperty.Tests.ps1 +++ b/tests/Remove-DbaExtendedProperty.Tests.ps1 @@ -6,31 +6,31 @@ Describe "Remove-DbaExtendedProperty" { $CommandUnderTest = Get-Command Remove-DbaExtendedProperty } It "Accepts InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type ExtendedProperty[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Accepts EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Accepts WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type System.String + $CommandUnderTest | Should -HaveParameter WarningVariable } It "Accepts InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type System.String + $CommandUnderTest | Should -HaveParameter InformationVariable } It "Accepts OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type System.String + $CommandUnderTest | Should -HaveParameter OutVariable } It "Accepts OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type System.Int32 + $CommandUnderTest | Should -HaveParameter OutBuffer } It "Accepts PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type System.String + $CommandUnderTest | Should -HaveParameter PipelineVariable } It "Accepts WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter WhatIf } It "Accepts Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Confirm } } @@ -38,18 +38,18 @@ Describe "Remove-DbaExtendedProperty" { BeforeAll { $random = Get-Random $instance2 = Connect-DbaInstance -SqlInstance $global:instance2 - $null = Get-DbaProcess -SqlInstance $instance2 | Where-Object Program -match dbatools | Stop-DbaProcess -Confirm:$false + $null = Get-DbaProcess -SqlInstance $instance2 | Where-Object Program -match dbatools | Stop-DbaProcess $newDbName = "dbatoolsci_newdb_$random" $db = New-DbaDatabase -SqlInstance $instance2 -Name $newDbName } AfterAll { - $null = $db | Remove-DbaDatabase -Confirm:$false + $null = $db | Remove-DbaDatabase } It "removes an extended property" { $ep = $db | Add-DbaExtendedProperty -Name "Test_Database_Name" -Value $newDbName - $results = $ep | Remove-DbaExtendedProperty -Confirm:$false + $results = $ep | Remove-DbaExtendedProperty $results.Name | Should -Be "Test_Database_Name" $results.Status | Should -Be "Dropped" } diff --git a/tests/Remove-DbaFirewallRule.Tests.ps1 b/tests/Remove-DbaFirewallRule.Tests.ps1 index 19836fe138..266c7a8f37 100644 --- a/tests/Remove-DbaFirewallRule.Tests.ps1 +++ b/tests/Remove-DbaFirewallRule.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Remove-DbaFirewallRule" { $CommandUnderTest = Get-Command Remove-DbaFirewallRule } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] + $CommandUnderTest | Should -HaveParameter Type } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Remove-DbaLinkedServer.Tests.ps1 b/tests/Remove-DbaLinkedServer.Tests.ps1 index d5052bce8f..3031a231af 100644 --- a/tests/Remove-DbaLinkedServer.Tests.ps1 +++ b/tests/Remove-DbaLinkedServer.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaLinkedServer" { $CommandUnderTest = Get-Command Remove-DbaLinkedServer } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have LinkedServer as a parameter" { - $CommandUnderTest | Should -HaveParameter LinkedServer -Type System.String[] + $CommandUnderTest | Should -HaveParameter LinkedServer } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaLinkedServerLogin.Tests.ps1 b/tests/Remove-DbaLinkedServerLogin.Tests.ps1 index 88478f46a9..75a1ebfa4d 100644 --- a/tests/Remove-DbaLinkedServerLogin.Tests.ps1 +++ b/tests/Remove-DbaLinkedServerLogin.Tests.ps1 @@ -49,22 +49,22 @@ Describe "Remove-DbaLinkedServerLogin" { $CommandUnderTest = Get-Command Remove-DbaLinkedServerLogin } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have LinkedServer as a parameter" { - $CommandUnderTest | Should -HaveParameter LinkedServer -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LinkedServer } It "Should have LocalLogin as a parameter" { - $CommandUnderTest | Should -HaveParameter LocalLogin -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LocalLogin } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaLogin.Tests.ps1 b/tests/Remove-DbaLogin.Tests.ps1 index 7dd2dfcccb..0dc7bc5c4b 100644 --- a/tests/Remove-DbaLogin.Tests.ps1 +++ b/tests/Remove-DbaLogin.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Remove-DbaLogin" { $CommandUnderTest = Get-Command Remove-DbaLogin } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Login } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Login[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaNetworkCertificate.Tests.ps1 b/tests/Remove-DbaNetworkCertificate.Tests.ps1 index fb71c457dd..a94ea7d5cd 100644 --- a/tests/Remove-DbaNetworkCertificate.Tests.ps1 +++ b/tests/Remove-DbaNetworkCertificate.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Remove-DbaNetworkCertificate" { $CommandUnderTest = Get-Command Remove-DbaNetworkCertificate } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Confirm } } } diff --git a/tests/Remove-DbaPfDataCollectorCounter.Tests.ps1 b/tests/Remove-DbaPfDataCollectorCounter.Tests.ps1 index 4038518364..184cfd7103 100644 --- a/tests/Remove-DbaPfDataCollectorCounter.Tests.ps1 +++ b/tests/Remove-DbaPfDataCollectorCounter.Tests.ps1 @@ -5,25 +5,25 @@ Describe "Remove-DbaPfDataCollectorCounter" { $CommandUnderTest = Get-Command Remove-DbaPfDataCollectorCounter } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have CollectorSet as a parameter" { - $CommandUnderTest | Should -HaveParameter CollectorSet -Type System.String[] + $CommandUnderTest | Should -HaveParameter CollectorSet } It "Should have Collector as a parameter" { - $CommandUnderTest | Should -HaveParameter Collector -Type System.String[] + $CommandUnderTest | Should -HaveParameter Collector } It "Should have Counter as a parameter" { - $CommandUnderTest | Should -HaveParameter Counter -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Counter } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } @@ -33,13 +33,13 @@ Describe "Remove-DbaPfDataCollectorCounter Integration Tests" -Tag "IntegrationT $null = Get-DbaPfDataCollectorSetTemplate -Template 'Long Running Queries' | Import-DbaPfDataCollectorSetTemplate } AfterAll { - $null = Get-DbaPfDataCollectorSet -CollectorSet 'Long Running Queries' | Remove-DbaPfDataCollectorSet -Confirm:$false + $null = Get-DbaPfDataCollectorSet -CollectorSet 'Long Running Queries' | Remove-DbaPfDataCollectorSet } Context "Verifying command returns all the required results" { It "returns the correct values" { $results = Get-DbaPfDataCollectorSet -CollectorSet 'Long Running Queries' | Get-DbaPfDataCollector | Get-DbaPfDataCollectorCounter -Counter '\LogicalDisk(*)\Avg. Disk Queue Length' | - Remove-DbaPfDataCollectorCounter -Counter '\LogicalDisk(*)\Avg. Disk Queue Length' -Confirm:$false + Remove-DbaPfDataCollectorCounter -Counter '\LogicalDisk(*)\Avg. Disk Queue Length' $results.DataCollectorSet | Should -Be 'Long Running Queries' $results.Name | Should -Be '\LogicalDisk(*)\Avg. Disk Queue Length' $results.Status | Should -Be 'Removed' diff --git a/tests/Remove-DbaPfDataCollectorSet.Tests.ps1 b/tests/Remove-DbaPfDataCollectorSet.Tests.ps1 index 8b8d7796dd..212e6e6b98 100644 --- a/tests/Remove-DbaPfDataCollectorSet.Tests.ps1 +++ b/tests/Remove-DbaPfDataCollectorSet.Tests.ps1 @@ -20,19 +20,19 @@ Describe "Remove-DbaPfDataCollectorSet" { $CommandUnderTest = Get-Command Remove-DbaPfDataCollectorSet } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have CollectorSet as a parameter" { - $CommandUnderTest | Should -HaveParameter CollectorSet -Type System.String[] + $CommandUnderTest | Should -HaveParameter CollectorSet } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaRegServer.Tests.ps1 b/tests/Remove-DbaRegServer.Tests.ps1 index 6748b77806..8842d7da80 100644 --- a/tests/Remove-DbaRegServer.Tests.ps1 +++ b/tests/Remove-DbaRegServer.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Remove-DbaRegServer" { $CommandUnderTest = Get-Command Remove-DbaRegServer } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] + $CommandUnderTest | Should -HaveParameter Name } It "Should have ServerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ServerName -Type System.String[] + $CommandUnderTest | Should -HaveParameter ServerName } It "Should have Group as a parameter" { - $CommandUnderTest | Should -HaveParameter Group -Type System.String[] + $CommandUnderTest | Should -HaveParameter Group } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.RegisteredServers.RegisteredServer[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -43,17 +43,17 @@ Describe "Remove-DbaRegServer" { $newServer2 = Add-DbaRegServer -SqlInstance $global:instance1 -ServerName $srvName2 -Name $regSrvName2 -Description $regSrvDesc2 } AfterAll { - Get-DbaRegServer -SqlInstance $global:instance1 -Name $regSrvName, $regSrvName2, $regSrvName3 | Remove-DbaRegServer -Confirm:$false + Get-DbaRegServer -SqlInstance $global:instance1 -Name $regSrvName, $regSrvName2, $regSrvName3 | Remove-DbaRegServer } It "supports dropping via the pipeline" { - $results = $newServer | Remove-DbaRegServer -Confirm:$false + $results = $newServer | Remove-DbaRegServer $results.Name | Should -Be $regSrvName $results.Status | Should -Be 'Dropped' } It "supports dropping manually" { - $results = Remove-DbaRegServer -Confirm:$false -SqlInstance $global:instance1 -Name $regSrvName2 + $results = Remove-DbaRegServer -SqlInstance $global:instance1 -Name $regSrvName2 $results.Name | Should -Be $regSrvName2 $results.Status | Should -Be 'Dropped' } diff --git a/tests/Remove-DbaRegServerGroup.Tests.ps1 b/tests/Remove-DbaRegServerGroup.Tests.ps1 index e9c313cc09..6583f64a9d 100644 --- a/tests/Remove-DbaRegServerGroup.Tests.ps1 +++ b/tests/Remove-DbaRegServerGroup.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Remove-DbaRegServerGroup" { $CommandUnderTest = Get-Command Remove-DbaRegServerGroup } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] + $CommandUnderTest | Should -HaveParameter Name } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.RegisteredServers.ServerGroup[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -44,17 +44,17 @@ Describe "Remove-DbaRegServerGroup" { AfterAll { Get-DbaRegServerGroup -SqlInstance $global:instance1 | Where-Object Name -match dbatoolsci | - Remove-DbaRegServerGroup -Confirm:$false + Remove-DbaRegServerGroup } It "supports dropping via the pipeline" { - $results = $newGroup | Remove-DbaRegServerGroup -Confirm:$false + $results = $newGroup | Remove-DbaRegServerGroup $results.Name | Should -Be $group $results.Status | Should -Be 'Dropped' } It "supports dropping manually" { - $results = Remove-DbaRegServerGroup -Confirm:$false -SqlInstance $global:instance1 -Name $group2 + $results = Remove-DbaRegServerGroup -SqlInstance $global:instance1 -Name $group2 $results.Name | Should -Be $group2 $results.Status | Should -Be 'Dropped' } diff --git a/tests/Remove-DbaReplArticle.Tests.ps1 b/tests/Remove-DbaReplArticle.Tests.ps1 index f5286b6502..11ce16c065 100644 --- a/tests/Remove-DbaReplArticle.Tests.ps1 +++ b/tests/Remove-DbaReplArticle.Tests.ps1 @@ -11,28 +11,28 @@ Describe "Remove-DbaReplArticle" { $CommandUnderTest = Get-Command Remove-DbaReplArticle } It "Should have SqlInstance as a Mandatory parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as an optional parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as an optional parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have Publication as an optional parameter" { - $CommandUnderTest | Should -HaveParameter Publication -Type System.String + $CommandUnderTest | Should -HaveParameter Publication } It "Should have Schema as an optional parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String + $CommandUnderTest | Should -HaveParameter Schema } It "Should have Name as an optional parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String + $CommandUnderTest | Should -HaveParameter Name } It "Should have InputObject as an optional parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Replication.Article[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as an optional parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Remove-DbaReplPublication.Tests.ps1 b/tests/Remove-DbaReplPublication.Tests.ps1 index dc2d077a78..cd9510c0ca 100644 --- a/tests/Remove-DbaReplPublication.Tests.ps1 +++ b/tests/Remove-DbaReplPublication.Tests.ps1 @@ -11,22 +11,22 @@ Describe "Remove-DbaReplPublication" { $CommandUnderTest = Get-Command Remove-DbaReplPublication } It "Should have SqlInstance as a mandatory parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as an optional parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as an optional parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Name as an optional parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] + $CommandUnderTest | Should -HaveParameter Name } It "Should have InputObject as an optional parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Replication.Publication[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as an optional parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Remove-DbaReplSubscription.Tests.ps1 b/tests/Remove-DbaReplSubscription.Tests.ps1 index 99eebc40eb..88964f93d4 100644 --- a/tests/Remove-DbaReplSubscription.Tests.ps1 +++ b/tests/Remove-DbaReplSubscription.Tests.ps1 @@ -11,34 +11,34 @@ Describe "Remove-DbaReplSubscription" { $CommandUnderTest = Get-Command Remove-DbaReplSubscription } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have PublicationName parameter" { - $CommandUnderTest | Should -HaveParameter PublicationName -Type System.String + $CommandUnderTest | Should -HaveParameter PublicationName } It "Should have SubscriberSqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SubscriberSqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SubscriberSqlInstance } It "Should have SubscriberSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SubscriberSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SubscriberSqlCredential } It "Should have SubscriptionDatabase parameter" { - $CommandUnderTest | Should -HaveParameter SubscriptionDatabase -Type System.String + $CommandUnderTest | Should -HaveParameter SubscriptionDatabase } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Confirm } } } diff --git a/tests/Remove-DbaRgResourcePool.Tests.ps1 b/tests/Remove-DbaRgResourcePool.Tests.ps1 index a138b432f0..cb25b64dca 100644 --- a/tests/Remove-DbaRgResourcePool.Tests.ps1 +++ b/tests/Remove-DbaRgResourcePool.Tests.ps1 @@ -10,25 +10,25 @@ Describe "Remove-DbaRgResourcePool" { $CommandUnderTest = Get-Command Remove-DbaRgResourcePool } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential } It "Should have ResourcePool parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePool -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ResourcePool -Type System.String[] } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type -Type System.String } It "Should have SkipReconfigure parameter" { - $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type System.Management.Automation.SwitchParameter } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter } } diff --git a/tests/Remove-DbaRgWorkloadGroup.Tests.ps1 b/tests/Remove-DbaRgWorkloadGroup.Tests.ps1 index 3e5da10742..cdd8755f8e 100644 --- a/tests/Remove-DbaRgWorkloadGroup.Tests.ps1 +++ b/tests/Remove-DbaRgWorkloadGroup.Tests.ps1 @@ -10,28 +10,28 @@ Describe "Remove-DbaRgWorkloadGroup" { $CommandUnderTest = Get-Command Remove-DbaRgWorkloadGroup } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have WorkloadGroup parameter" { - $CommandUnderTest | Should -HaveParameter WorkloadGroup -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WorkloadGroup } It "Should have ResourcePool parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePool -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ResourcePool } It "Should have ResourcePoolType parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePoolType -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ResourcePoolType } It "Should have SkipReconfigure parameter" { - $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SkipReconfigure } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.WorkloadGroup[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaServerRole.Tests.ps1 b/tests/Remove-DbaServerRole.Tests.ps1 index ea92895a79..d3179a9db9 100644 --- a/tests/Remove-DbaServerRole.Tests.ps1 +++ b/tests/Remove-DbaServerRole.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Remove-DbaServerRole Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Remove-DbaServerRole } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have ServerRole as a parameter" { - $CommandUnderTest | Should -HaveParameter ServerRole -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ServerRole } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.ServerRole[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Remove-DbaServerRoleMember.Tests.ps1 b/tests/Remove-DbaServerRoleMember.Tests.ps1 index f74739ef02..771de1ab45 100644 --- a/tests/Remove-DbaServerRoleMember.Tests.ps1 +++ b/tests/Remove-DbaServerRoleMember.Tests.ps1 @@ -27,25 +27,25 @@ Describe "Remove-DbaServerRoleMember" { $CommandUnderTest = Get-Command Remove-DbaServerRoleMember } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have ServerRole as a parameter" { - $CommandUnderTest | Should -HaveParameter ServerRole -Type System.String[] + $CommandUnderTest | Should -HaveParameter ServerRole } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String[] + $CommandUnderTest | Should -HaveParameter Login } It "Should have Role as a parameter" { - $CommandUnderTest | Should -HaveParameter Role -Type System.String[] + $CommandUnderTest | Should -HaveParameter Role } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaSpn.Tests.ps1 b/tests/Remove-DbaSpn.Tests.ps1 index ffe1856b3a..7aa7b39db6 100644 --- a/tests/Remove-DbaSpn.Tests.ps1 +++ b/tests/Remove-DbaSpn.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaSpn" { $CommandUnderTest = Get-Command Remove-DbaSpn } It "Accepts SPN as a parameter" { - $CommandUnderTest | Should -HaveParameter SPN -Type System.String + $CommandUnderTest | Should -HaveParameter SPN } It "Accepts ServiceAccount as a parameter" { - $CommandUnderTest | Should -HaveParameter ServiceAccount -Type System.String + $CommandUnderTest | Should -HaveParameter ServiceAccount } It "Accepts Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Accepts EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Accepts WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter WhatIf } It "Accepts Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Confirm } } diff --git a/tests/Remove-DbaTrace.Tests.ps1 b/tests/Remove-DbaTrace.Tests.ps1 index f70dd34532..0f8989b5e7 100644 --- a/tests/Remove-DbaTrace.Tests.ps1 +++ b/tests/Remove-DbaTrace.Tests.ps1 @@ -5,19 +5,19 @@ Describe "Remove-DbaTrace" { $CommandUnderTest = Get-Command Remove-DbaTrace } It "Accepts SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Accepts SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Accepts Id as a parameter" { - $CommandUnderTest | Should -HaveParameter Id -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter Id } It "Accepts InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Accepts EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaXESession.Tests.ps1 b/tests/Remove-DbaXESession.Tests.ps1 index 4e27284c86..9d08eace22 100644 --- a/tests/Remove-DbaXESession.Tests.ps1 +++ b/tests/Remove-DbaXESession.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaXESession" { $CommandUnderTest = Get-Command Remove-DbaXESession } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Session as a parameter" { - $CommandUnderTest | Should -HaveParameter Session -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Session } It "Should have AllSessions as a switch parameter" { - $CommandUnderTest | Should -HaveParameter AllSessions -Type switch + $CommandUnderTest | Should -HaveParameter AllSessions } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.XEvent.Session[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Remove-DbaXESmartTarget.Tests.ps1 b/tests/Remove-DbaXESmartTarget.Tests.ps1 index 6a3f1d9ef1..968e7d751d 100644 --- a/tests/Remove-DbaXESmartTarget.Tests.ps1 +++ b/tests/Remove-DbaXESmartTarget.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Remove-DbaXESmartTarget" { $CommandUnderTest = Get-Command Remove-DbaXESmartTarget } It "Accepts InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Accepts EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Accepts WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WhatIf } It "Accepts Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Confirm } } } diff --git a/tests/Rename-DbaDatabase.Tests.ps1 b/tests/Rename-DbaDatabase.Tests.ps1 index 56ce86bec9..9f9bacaeb6 100644 --- a/tests/Rename-DbaDatabase.Tests.ps1 +++ b/tests/Rename-DbaDatabase.Tests.ps1 @@ -19,7 +19,7 @@ Describe "Rename-DbaDatabase" { } AfterAll { - $null = Remove-DbaDatabase -SqlInstance $global:instance2 -Database "test_dbatoolsci_rename2_$($date)", "Dbatoolsci_filemove", "dbatoolsci_logicname", "dbatoolsci_filegroupname" -Confirm:$false + $null = Remove-DbaDatabase -SqlInstance $global:instance2 -Database "test_dbatoolsci_rename2_$($date)", "Dbatoolsci_filemove", "dbatoolsci_logicname", "dbatoolsci_filegroupname" } Context "Validate parameters" { @@ -27,52 +27,52 @@ Describe "Rename-DbaDatabase" { $CommandUnderTest = Get-Command Rename-DbaDatabase } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have AllDatabases as a switch parameter" { - $CommandUnderTest | Should -HaveParameter AllDatabases -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AllDatabases } It "Should have DatabaseName as a parameter" { - $CommandUnderTest | Should -HaveParameter DatabaseName -Type System.String + $CommandUnderTest | Should -HaveParameter DatabaseName } It "Should have FileGroupName as a parameter" { - $CommandUnderTest | Should -HaveParameter FileGroupName -Type System.String + $CommandUnderTest | Should -HaveParameter FileGroupName } It "Should have LogicalName as a parameter" { - $CommandUnderTest | Should -HaveParameter LogicalName -Type System.String + $CommandUnderTest | Should -HaveParameter LogicalName } It "Should have FileName as a parameter" { - $CommandUnderTest | Should -HaveParameter FileName -Type System.String + $CommandUnderTest | Should -HaveParameter FileName } It "Should have ReplaceBefore as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ReplaceBefore -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ReplaceBefore } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have Move as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Move -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Move } It "Should have SetOffline as a switch parameter" { - $CommandUnderTest | Should -HaveParameter SetOffline -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter SetOffline } It "Should have Preview as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Preview -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Preview } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Rename-DbaLogin.Tests.ps1 b/tests/Rename-DbaLogin.Tests.ps1 index cb53e36b43..ce2b438238 100644 --- a/tests/Rename-DbaLogin.Tests.ps1 +++ b/tests/Rename-DbaLogin.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Rename-DbaLogin" { $CommandUnderTest = Get-Command Rename-DbaLogin } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String + $CommandUnderTest | Should -HaveParameter Login } It "Should have NewLogin as a parameter" { - $CommandUnderTest | Should -HaveParameter NewLogin -Type System.String + $CommandUnderTest | Should -HaveParameter NewLogin } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Repair-DbaDbMirror.Tests.ps1 b/tests/Repair-DbaDbMirror.Tests.ps1 index 4e68cc4243..82a37b6cb9 100644 --- a/tests/Repair-DbaDbMirror.Tests.ps1 +++ b/tests/Repair-DbaDbMirror.Tests.ps1 @@ -9,26 +9,26 @@ Describe "Repair-DbaDbMirror" { BeforeAll { $CommandUnderTest = Get-Command Repair-DbaDbMirror } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.SqlServer.Management.Smo.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have InputObject as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Confirm } } diff --git a/tests/Repair-DbaDbOrphanUser.Tests.ps1 b/tests/Repair-DbaDbOrphanUser.Tests.ps1 index 3f019530e8..af3ae681f1 100644 --- a/tests/Repair-DbaDbOrphanUser.Tests.ps1 +++ b/tests/Repair-DbaDbOrphanUser.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Repair-DbaDbOrphanUser" { $CommandUnderTest = Get-Command Repair-DbaDbOrphanUser } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Users parameter" { - $CommandUnderTest | Should -HaveParameter Users -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Users } It "Should have RemoveNotExisting parameter" { - $CommandUnderTest | Should -HaveParameter RemoveNotExisting -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter RemoveNotExisting } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -40,8 +40,8 @@ CREATE LOGIN [dbatoolsci_orphan3] WITH PASSWORD = N'password3', CHECK_EXPIRATION CREATE DATABASE dbatoolsci_orphan; '@ $server = Connect-DbaInstance -SqlInstance $global:instance1 - $null = Remove-DbaLogin -SqlInstance $server -Login dbatoolsci_orphan1, dbatoolsci_orphan2, dbatoolsci_orphan3 -Force -Confirm:$false - $null = Remove-DbaDatabase -SqlInstance $server -Database dbatoolsci_orphan -Confirm:$false + $null = Remove-DbaLogin -SqlInstance $server -Login dbatoolsci_orphan1, dbatoolsci_orphan2, dbatoolsci_orphan3 -Force + $null = Remove-DbaDatabase -SqlInstance $server -Database dbatoolsci_orphan $null = Invoke-DbaQuery -SqlInstance $server -Query $loginsq $usersq = @' CREATE USER [dbatoolsci_orphan1] FROM LOGIN [dbatoolsci_orphan1]; @@ -60,8 +60,8 @@ CREATE LOGIN [dbatoolsci_orphan2] WITH PASSWORD = N'password2', CHECK_EXPIRATION AfterAll { $server = Connect-DbaInstance -SqlInstance $global:instance1 - $null = Remove-DbaLogin -SqlInstance $server -Login dbatoolsci_orphan1, dbatoolsci_orphan2, dbatoolsci_orphan3 -Force -Confirm:$false - $null = Remove-DbaDatabase -SqlInstance $server -Database dbatoolsci_orphan -Confirm:$false + $null = Remove-DbaLogin -SqlInstance $server -Login dbatoolsci_orphan1, dbatoolsci_orphan2, dbatoolsci_orphan3 -Force + $null = Remove-DbaDatabase -SqlInstance $server -Database dbatoolsci_orphan } It "Finds two orphans" { diff --git a/tests/Repair-DbaInstanceName.Tests.ps1 b/tests/Repair-DbaInstanceName.Tests.ps1 index 1a063d254c..1c1b6c22bb 100644 --- a/tests/Repair-DbaInstanceName.Tests.ps1 +++ b/tests/Repair-DbaInstanceName.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Repair-DbaInstanceName" { $CommandUnderTest = Get-Command Repair-DbaInstanceName } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have AutoFix parameter" { - $CommandUnderTest | Should -HaveParameter AutoFix -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AutoFix } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Reset-DbaAdmin.Tests.ps1 b/tests/Reset-DbaAdmin.Tests.ps1 index 81e41217c0..5c36edce14 100644 --- a/tests/Reset-DbaAdmin.Tests.ps1 +++ b/tests/Reset-DbaAdmin.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Reset-DbaAdmin" { $CommandUnderTest = Get-Command Reset-DbaAdmin } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String + $CommandUnderTest | Should -HaveParameter Login } It "Should have SecurePassword as a parameter" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter SecurePassword } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Reset-DbatoolsConfig.Tests.ps1 b/tests/Reset-DbatoolsConfig.Tests.ps1 index 604b548e8b..55ce36279b 100644 --- a/tests/Reset-DbatoolsConfig.Tests.ps1 +++ b/tests/Reset-DbatoolsConfig.Tests.ps1 @@ -11,26 +11,26 @@ Describe "Reset-DbatoolsConfig" { BeforeAll { $CommandUnderTest = Get-Command Reset-DbatoolsConfig } - It "Should have ConfigurationItem as a non-mandatory parameter of type Dataplat.Dbatools.Configuration.Config[]" { - $CommandUnderTest | Should -HaveParameter ConfigurationItem -Type Dataplat.Dbatools.Configuration.Config[] -Mandatory:$false + It "Should have ConfigurationItem as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ConfigurationItem } - It "Should have FullName as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter FullName -Type System.String[] -Mandatory:$false + It "Should have FullName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter FullName } - It "Should have Module as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Module -Type System.String -Mandatory:$false + It "Should have Module as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Module } - It "Should have Name as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String -Mandatory:$false + It "Should have Name as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Name } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Confirm } } } diff --git a/tests/Resolve-DbaNetworkName.Tests.ps1 b/tests/Resolve-DbaNetworkName.Tests.ps1 index e82d182723..0aec3ae3b8 100644 --- a/tests/Resolve-DbaNetworkName.Tests.ps1 +++ b/tests/Resolve-DbaNetworkName.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Resolve-DbaNetworkName Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Resolve-DbaNetworkName } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Turbo as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Turbo -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Turbo } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Resolve-DbaPath.Tests.ps1 b/tests/Resolve-DbaPath.Tests.ps1 index 5e9e8dad91..daaf339296 100644 --- a/tests/Resolve-DbaPath.Tests.ps1 +++ b/tests/Resolve-DbaPath.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Resolve-DbaPath Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Resolve-DbaPath } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have Provider as a parameter" { - $CommandUnderTest | Should -HaveParameter Provider -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Provider } It "Should have SingleItem as a parameter" { - $CommandUnderTest | Should -HaveParameter SingleItem -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SingleItem } It "Should have NewChild as a parameter" { - $CommandUnderTest | Should -HaveParameter NewChild -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NewChild } } } diff --git a/tests/Restart-DbaService.Tests.ps1 b/tests/Restart-DbaService.Tests.ps1 index d77a64e299..11788e9e15 100644 --- a/tests/Restart-DbaService.Tests.ps1 +++ b/tests/Restart-DbaService.Tests.ps1 @@ -10,31 +10,31 @@ Describe "Restart-DbaService" { $CommandUnderTest = Get-Command Restart-DbaService } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] } It "Should have InstanceName as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter InstanceName -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InstanceName -Type System.String[] } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] } It "Should have Type as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type -Type System.String[] } It "Should have InputObject as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] } It "Should have Timeout as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter Timeout -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Timeout -Type System.Int32 } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential } It "Should have Force as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter } } diff --git a/tests/Restore-DbaDatabase.Tests.ps1 b/tests/Restore-DbaDatabase.Tests.ps1 index 51026641eb..2cf8fcbca4 100644 --- a/tests/Restore-DbaDatabase.Tests.ps1 +++ b/tests/Restore-DbaDatabase.Tests.ps1 @@ -12,157 +12,157 @@ Describe "Restore-DbaDatabase Unit Tests" -Tag 'UnitTests' { $commonParameters = [System.Management.Automation.PSCmdlet]::CommonParameters } It "Should have SqlInstance parameter" { - $command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter -Mandatory:$false + $command | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $command | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $command | Should -HaveParameter SqlCredential } It "Should have Path parameter" { - $command | Should -HaveParameter Path -Type Object[] -Mandatory:$false + $command | Should -HaveParameter Path } It "Should have DatabaseName parameter" { - $command | Should -HaveParameter DatabaseName -Type Object[] -Mandatory:$false + $command | Should -HaveParameter DatabaseName } It "Should have DestinationDataDirectory parameter" { - $command | Should -HaveParameter DestinationDataDirectory -Type String -Mandatory:$false + $command | Should -HaveParameter DestinationDataDirectory } It "Should have DestinationLogDirectory parameter" { - $command | Should -HaveParameter DestinationLogDirectory -Type String -Mandatory:$false + $command | Should -HaveParameter DestinationLogDirectory } It "Should have DestinationFileStreamDirectory parameter" { - $command | Should -HaveParameter DestinationFileStreamDirectory -Type String -Mandatory:$false + $command | Should -HaveParameter DestinationFileStreamDirectory } It "Should have RestoreTime parameter" { - $command | Should -HaveParameter RestoreTime -Type DateTime -Mandatory:$false + $command | Should -HaveParameter RestoreTime } It "Should have NoRecovery parameter" { - $command | Should -HaveParameter NoRecovery -Type Switch -Mandatory:$false + $command | Should -HaveParameter NoRecovery } It "Should have WithReplace parameter" { - $command | Should -HaveParameter WithReplace -Type Switch -Mandatory:$false + $command | Should -HaveParameter WithReplace } It "Should have KeepReplication parameter" { - $command | Should -HaveParameter KeepReplication -Type Switch -Mandatory:$false + $command | Should -HaveParameter KeepReplication } It "Should have XpDirTree parameter" { - $command | Should -HaveParameter XpDirTree -Type Switch -Mandatory:$false + $command | Should -HaveParameter XpDirTree } It "Should have NoXpDirRecurse parameter" { - $command | Should -HaveParameter NoXpDirRecurse -Type Switch -Mandatory:$false + $command | Should -HaveParameter NoXpDirRecurse } It "Should have OutputScriptOnly parameter" { - $command | Should -HaveParameter OutputScriptOnly -Type Switch -Mandatory:$false + $command | Should -HaveParameter OutputScriptOnly } It "Should have VerifyOnly parameter" { - $command | Should -HaveParameter VerifyOnly -Type Switch -Mandatory:$false + $command | Should -HaveParameter VerifyOnly } It "Should have MaintenanceSolutionBackup parameter" { - $command | Should -HaveParameter MaintenanceSolutionBackup -Type Switch -Mandatory:$false + $command | Should -HaveParameter MaintenanceSolutionBackup } It "Should have FileMapping parameter" { - $command | Should -HaveParameter FileMapping -Type Hashtable -Mandatory:$false + $command | Should -HaveParameter FileMapping } It "Should have IgnoreLogBackup parameter" { - $command | Should -HaveParameter IgnoreLogBackup -Type Switch -Mandatory:$false + $command | Should -HaveParameter IgnoreLogBackup } It "Should have IgnoreDiffBackup parameter" { - $command | Should -HaveParameter IgnoreDiffBackup -Type Switch -Mandatory:$false + $command | Should -HaveParameter IgnoreDiffBackup } It "Should have UseDestinationDefaultDirectories parameter" { - $command | Should -HaveParameter UseDestinationDefaultDirectories -Type Switch -Mandatory:$false + $command | Should -HaveParameter UseDestinationDefaultDirectories } It "Should have ReuseSourceFolderStructure parameter" { - $command | Should -HaveParameter ReuseSourceFolderStructure -Type Switch -Mandatory:$false + $command | Should -HaveParameter ReuseSourceFolderStructure } It "Should have DestinationFilePrefix parameter" { - $command | Should -HaveParameter DestinationFilePrefix -Type String -Mandatory:$false + $command | Should -HaveParameter DestinationFilePrefix } It "Should have RestoredDatabaseNamePrefix parameter" { - $command | Should -HaveParameter RestoredDatabaseNamePrefix -Type String -Mandatory:$false + $command | Should -HaveParameter RestoredDatabaseNamePrefix } It "Should have TrustDbBackupHistory parameter" { - $command | Should -HaveParameter TrustDbBackupHistory -Type Switch -Mandatory:$false + $command | Should -HaveParameter TrustDbBackupHistory } It "Should have MaxTransferSize parameter" { - $command | Should -HaveParameter MaxTransferSize -Type Int32 -Mandatory:$false + $command | Should -HaveParameter MaxTransferSize } It "Should have BlockSize parameter" { - $command | Should -HaveParameter BlockSize -Type Int32 -Mandatory:$false + $command | Should -HaveParameter BlockSize } It "Should have BufferCount parameter" { - $command | Should -HaveParameter BufferCount -Type Int32 -Mandatory:$false + $command | Should -HaveParameter BufferCount } It "Should have DirectoryRecurse parameter" { - $command | Should -HaveParameter DirectoryRecurse -Type Switch -Mandatory:$false + $command | Should -HaveParameter DirectoryRecurse } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type Switch -Mandatory:$false + $command | Should -HaveParameter EnableException } It "Should have StandbyDirectory parameter" { - $command | Should -HaveParameter StandbyDirectory -Type String -Mandatory:$false + $command | Should -HaveParameter StandbyDirectory } It "Should have Continue parameter" { - $command | Should -HaveParameter Continue -Type Switch -Mandatory:$false + $command | Should -HaveParameter Continue } It "Should have ExecuteAs parameter" { - $command | Should -HaveParameter ExecuteAs -Type String -Mandatory:$false + $command | Should -HaveParameter ExecuteAs } It "Should have AzureCredential parameter" { - $command | Should -HaveParameter AzureCredential -Type String -Mandatory:$false + $command | Should -HaveParameter AzureCredential } It "Should have ReplaceDbNameInFile parameter" { - $command | Should -HaveParameter ReplaceDbNameInFile -Type Switch -Mandatory:$false + $command | Should -HaveParameter ReplaceDbNameInFile } It "Should have DestinationFileSuffix parameter" { - $command | Should -HaveParameter DestinationFileSuffix -Type String -Mandatory:$false + $command | Should -HaveParameter DestinationFileSuffix } It "Should have Recover parameter" { - $command | Should -HaveParameter Recover -Type Switch -Mandatory:$false + $command | Should -HaveParameter Recover } It "Should have KeepCDC parameter" { - $command | Should -HaveParameter KeepCDC -Type Switch -Mandatory:$false + $command | Should -HaveParameter KeepCDC } It "Should have GetBackupInformation parameter" { - $command | Should -HaveParameter GetBackupInformation -Type String -Mandatory:$false + $command | Should -HaveParameter GetBackupInformation } It "Should have StopAfterGetBackupInformation parameter" { - $command | Should -HaveParameter StopAfterGetBackupInformation -Type Switch -Mandatory:$false + $command | Should -HaveParameter StopAfterGetBackupInformation } It "Should have SelectBackupInformation parameter" { - $command | Should -HaveParameter SelectBackupInformation -Type String -Mandatory:$false + $command | Should -HaveParameter SelectBackupInformation } It "Should have StopAfterSelectBackupInformation parameter" { - $command | Should -HaveParameter StopAfterSelectBackupInformation -Type Switch -Mandatory:$false + $command | Should -HaveParameter StopAfterSelectBackupInformation } It "Should have FormatBackupInformation parameter" { - $command | Should -HaveParameter FormatBackupInformation -Type String -Mandatory:$false + $command | Should -HaveParameter FormatBackupInformation } It "Should have StopAfterFormatBackupInformation parameter" { - $command | Should -HaveParameter StopAfterFormatBackupInformation -Type Switch -Mandatory:$false + $command | Should -HaveParameter StopAfterFormatBackupInformation } It "Should have TestBackupInformation parameter" { - $command | Should -HaveParameter TestBackupInformation -Type String -Mandatory:$false + $command | Should -HaveParameter TestBackupInformation } It "Should have StopAfterTestBackupInformation parameter" { - $command | Should -HaveParameter StopAfterTestBackupInformation -Type Switch -Mandatory:$false + $command | Should -HaveParameter StopAfterTestBackupInformation } It "Should have PageRestore parameter" { - $command | Should -HaveParameter PageRestore -Type Object -Mandatory:$false + $command | Should -HaveParameter PageRestore } It "Should have PageRestoreTailFolder parameter" { - $command | Should -HaveParameter PageRestoreTailFolder -Type String -Mandatory:$false + $command | Should -HaveParameter PageRestoreTailFolder } It "Should have StopBefore parameter" { - $command | Should -HaveParameter StopBefore -Type Switch -Mandatory:$false + $command | Should -HaveParameter StopBefore } It "Should have StopMark parameter" { - $command | Should -HaveParameter StopMark -Type String -Mandatory:$false + $command | Should -HaveParameter StopMark } It "Should have StopAfterDate parameter" { - $command | Should -HaveParameter StopAfterDate -Type DateTime -Mandatory:$false + $command | Should -HaveParameter StopAfterDate } It "Should have StatementTimeout parameter" { - $command | Should -HaveParameter StatementTimeout -Type Int32 -Mandatory:$false + $command | Should -HaveParameter StatementTimeout } } } diff --git a/tests/Restore-DbaDbCertificate.Tests.ps1 b/tests/Restore-DbaDbCertificate.Tests.ps1 index b84afc2778..1cfd58738b 100644 --- a/tests/Restore-DbaDbCertificate.Tests.ps1 +++ b/tests/Restore-DbaDbCertificate.Tests.ps1 @@ -6,31 +6,31 @@ Describe "Restore-DbaDbCertificate" { $CommandUnderTest = Get-Command Restore-DbaDbCertificate } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String[] + $CommandUnderTest | Should -HaveParameter Path } It "Should have KeyFilePath parameter" { - $CommandUnderTest | Should -HaveParameter KeyFilePath -Type System.String[] + $CommandUnderTest | Should -HaveParameter KeyFilePath } It "Should have EncryptionPassword parameter" { - $CommandUnderTest | Should -HaveParameter EncryptionPassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter EncryptionPassword } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have Name parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String + $CommandUnderTest | Should -HaveParameter Name } It "Should have DecryptionPassword parameter" { - $CommandUnderTest | Should -HaveParameter DecryptionPassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter DecryptionPassword } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Restore-DbaDbSnapshot.Tests.ps1 b/tests/Restore-DbaDbSnapshot.Tests.ps1 index 7b6e653d80..b146138d6f 100644 --- a/tests/Restore-DbaDbSnapshot.Tests.ps1 +++ b/tests/Restore-DbaDbSnapshot.Tests.ps1 @@ -12,28 +12,28 @@ Describe "Restore-DbaDbSnapshot Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Restore-DbaDbSnapshot } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Snapshot as a parameter" { - $CommandUnderTest | Should -HaveParameter Snapshot -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Snapshot } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type switch + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Resume-DbaAgDbDataMovement.Tests.ps1 b/tests/Resume-DbaAgDbDataMovement.Tests.ps1 index e50ca57e09..46249d55f3 100644 --- a/tests/Resume-DbaAgDbDataMovement.Tests.ps1 +++ b/tests/Resume-DbaAgDbDataMovement.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Resume-DbaAgDbDataMovement" { $CommandUnderTest = Get-Command Resume-DbaAgDbDataMovement } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have AvailabilityGroup parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityDatabase[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Revoke-DbaAgPermission.Tests.ps1 b/tests/Revoke-DbaAgPermission.Tests.ps1 index e13b70dece..e93861f1b6 100644 --- a/tests/Revoke-DbaAgPermission.Tests.ps1 +++ b/tests/Revoke-DbaAgPermission.Tests.ps1 @@ -15,28 +15,28 @@ Describe "Revoke-DbaAgPermission" { Context "Validate parameters" { It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String[] + $CommandUnderTest | Should -HaveParameter Login } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String[] + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] + $CommandUnderTest | Should -HaveParameter Type } It "Should have Permission as a parameter" { - $CommandUnderTest | Should -HaveParameter Permission -Type System.String[] + $CommandUnderTest | Should -HaveParameter Permission } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Login[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Save-DbaCommunitySoftware.Tests.ps1 b/tests/Save-DbaCommunitySoftware.Tests.ps1 index b0e60fcc6c..1bd4c1d9be 100644 --- a/tests/Save-DbaCommunitySoftware.Tests.ps1 +++ b/tests/Save-DbaCommunitySoftware.Tests.ps1 @@ -11,23 +11,23 @@ Describe "Save-DbaCommunitySoftware" { BeforeAll { $CommandUnderTest = Get-Command Save-DbaCommunitySoftware } - It "Should have Software as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Software -Type System.String -Mandatory:$false + It "Should have Software as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Software } - It "Should have Branch as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Branch -Type System.String -Mandatory:$false + It "Should have Branch as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Branch } - It "Should have LocalFile as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter LocalFile -Type System.String -Mandatory:$false + It "Should have LocalFile as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter LocalFile } - It "Should have Url as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Url -Type System.String -Mandatory:$false + It "Should have Url as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Url } - It "Should have LocalDirectory as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter LocalDirectory -Type System.String -Mandatory:$false + It "Should have LocalDirectory as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter LocalDirectory } - It "Should have EnableException as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have EnableException as a non-mandatory SwitchParameter" { + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Save-DbaDiagnosticQueryScript.Tests.ps1 b/tests/Save-DbaDiagnosticQueryScript.Tests.ps1 index 29231a9612..bf86b564d5 100644 --- a/tests/Save-DbaDiagnosticQueryScript.Tests.ps1 +++ b/tests/Save-DbaDiagnosticQueryScript.Tests.ps1 @@ -11,11 +11,11 @@ Describe "Save-DbaDiagnosticQueryScript" { BeforeAll { $CommandUnderTest = Get-Command Save-DbaDiagnosticQueryScript } - It "Should have Path as a non-mandatory parameter of type FileInfo" { - $CommandUnderTest | Should -HaveParameter Path -Type Microsoft.SqlServer.Management.Smo.FileInfo -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Save-DbaKbUpdate.Tests.ps1 b/tests/Save-DbaKbUpdate.Tests.ps1 index efcb7043aa..1b916d3100 100644 --- a/tests/Save-DbaKbUpdate.Tests.ps1 +++ b/tests/Save-DbaKbUpdate.Tests.ps1 @@ -10,26 +10,26 @@ Describe "Save-DbaKbUpdate" { BeforeAll { $CommandUnderTest = Get-Command Save-DbaKbUpdate } - It "Should have Name as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] -Mandatory:$false + It "Should have Name as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Name } - It "Should have Path as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } - It "Should have FilePath as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String -Mandatory:$false + It "Should have FilePath as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter FilePath } - It "Should have Architecture as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Architecture -Type System.String -Mandatory:$false + It "Should have Architecture as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Architecture } - It "Should have Language as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Language -Type System.String -Mandatory:$false + It "Should have Language as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Language } - It "Should have InputObject as a non-mandatory System.Object[] parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } - It "Should have EnableException as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have EnableException as a non-mandatory SwitchParameter" { + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Select-DbaBackupInformation.Tests.ps1 b/tests/Select-DbaBackupInformation.Tests.ps1 index b8e719b4ab..157cb063d4 100644 --- a/tests/Select-DbaBackupInformation.Tests.ps1 +++ b/tests/Select-DbaBackupInformation.Tests.ps1 @@ -11,32 +11,32 @@ Describe "Select-DbaBackupInformation" { BeforeAll { $CommandUnderTest = Get-Command Select-DbaBackupInformation } - It "Should have BackupHistory as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter BackupHistory -Type System.Object[] -Mandatory:$false + It "Should have BackupHistory as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter BackupHistory } - It "Should have RestoreTime as a non-mandatory parameter of type System.DateTime" { - $CommandUnderTest | Should -HaveParameter RestoreTime -Type System.DateTime -Mandatory:$false + It "Should have RestoreTime as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter RestoreTime } It "Should have IgnoreLogs as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreLogs -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IgnoreLogs } It "Should have IgnoreDiffs as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreDiffs -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IgnoreDiffs } - It "Should have DatabaseName as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter DatabaseName -Type System.String[] -Mandatory:$false + It "Should have DatabaseName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter DatabaseName } - It "Should have ServerName as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter ServerName -Type System.String[] -Mandatory:$false + It "Should have ServerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ServerName } - It "Should have ContinuePoints as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter ContinuePoints -Type System.Object[] -Mandatory:$false + It "Should have ContinuePoints as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ContinuePoints } - It "Should have LastRestoreType as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter LastRestoreType -Type System.Object[] -Mandatory:$false + It "Should have LastRestoreType as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter LastRestoreType } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Select-DbaDbSequenceNextValue.Tests.ps1 b/tests/Select-DbaDbSequenceNextValue.Tests.ps1 index ece6cfb706..2f9c9efe8c 100644 --- a/tests/Select-DbaDbSequenceNextValue.Tests.ps1 +++ b/tests/Select-DbaDbSequenceNextValue.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Select-DbaDbSequenceNextValue" { $CommandUnderTest = Get-Command Select-DbaDbSequenceNextValue } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have Sequence as a parameter" { - $CommandUnderTest | Should -HaveParameter Sequence -Type System.String[] + $CommandUnderTest | Should -HaveParameter Sequence } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String + $CommandUnderTest | Should -HaveParameter Schema } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Select-DbaObject.Tests.ps1 b/tests/Select-DbaObject.Tests.ps1 index 2846df8719..7bf3850053 100644 --- a/tests/Select-DbaObject.Tests.ps1 +++ b/tests/Select-DbaObject.Tests.ps1 @@ -31,58 +31,58 @@ Describe "Select-DbaObject" { $CommandUnderTest = Get-Command Select-DbaObject } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Management.Automation.PSObject + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Property as a parameter" { - $CommandUnderTest | Should -HaveParameter Property -Type Dataplat.Dbatools.Parameter.DbaSelectParameter[] + $CommandUnderTest | Should -HaveParameter Property } It "Should have ExcludeProperty as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeProperty -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeProperty } It "Should have ExpandProperty as a parameter" { - $CommandUnderTest | Should -HaveParameter ExpandProperty -Type System.String + $CommandUnderTest | Should -HaveParameter ExpandProperty } It "Should have Alias as a parameter" { - $CommandUnderTest | Should -HaveParameter Alias -Type Dataplat.Dbatools.Parameter.SelectAliasParameter[] + $CommandUnderTest | Should -HaveParameter Alias } It "Should have ScriptProperty as a parameter" { - $CommandUnderTest | Should -HaveParameter ScriptProperty -Type Dataplat.Dbatools.Parameter.SelectScriptPropertyParameter[] + $CommandUnderTest | Should -HaveParameter ScriptProperty } It "Should have ScriptMethod as a parameter" { - $CommandUnderTest | Should -HaveParameter ScriptMethod -Type Dataplat.Dbatools.Parameter.SelectScriptMethodParameter[] + $CommandUnderTest | Should -HaveParameter ScriptMethod } It "Should have Unique as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Unique -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Unique } It "Should have Last as a parameter" { - $CommandUnderTest | Should -HaveParameter Last -Type System.Int32 + $CommandUnderTest | Should -HaveParameter Last } It "Should have First as a parameter" { - $CommandUnderTest | Should -HaveParameter First -Type System.Int32 + $CommandUnderTest | Should -HaveParameter First } It "Should have Skip as a parameter" { - $CommandUnderTest | Should -HaveParameter Skip -Type System.Int32 + $CommandUnderTest | Should -HaveParameter Skip } It "Should have SkipLast as a parameter" { - $CommandUnderTest | Should -HaveParameter SkipLast -Type System.Int32 + $CommandUnderTest | Should -HaveParameter SkipLast } It "Should have Wait as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Wait -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Wait } It "Should have Index as a parameter" { - $CommandUnderTest | Should -HaveParameter Index -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter Index } It "Should have ShowProperty as a parameter" { - $CommandUnderTest | Should -HaveParameter ShowProperty -Type System.String[] + $CommandUnderTest | Should -HaveParameter ShowProperty } It "Should have ShowExcludeProperty as a parameter" { - $CommandUnderTest | Should -HaveParameter ShowExcludeProperty -Type System.String[] + $CommandUnderTest | Should -HaveParameter ShowExcludeProperty } It "Should have TypeName as a parameter" { - $CommandUnderTest | Should -HaveParameter TypeName -Type System.String + $CommandUnderTest | Should -HaveParameter TypeName } It "Should have KeepInputObject as a switch parameter" { - $CommandUnderTest | Should -HaveParameter KeepInputObject -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter KeepInputObject } } diff --git a/tests/Set-DbaAgListener.Tests.ps1 b/tests/Set-DbaAgListener.Tests.ps1 index 61d7f3f06b..2cce1f700d 100644 --- a/tests/Set-DbaAgListener.Tests.ps1 +++ b/tests/Set-DbaAgListener.Tests.ps1 @@ -6,31 +6,31 @@ Describe "Set-DbaAgListener" { $CommandUnderTest = Get-Command Set-DbaAgListener } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String[] + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have Listener as a parameter" { - $CommandUnderTest | Should -HaveParameter Listener -Type System.String[] + $CommandUnderTest | Should -HaveParameter Listener } It "Should have Port as a parameter" { - $CommandUnderTest | Should -HaveParameter Port -Type System.Int32 + $CommandUnderTest | Should -HaveParameter Port } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityGroupListener[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Confirm } } } diff --git a/tests/Set-DbaAgReplica.Tests.ps1 b/tests/Set-DbaAgReplica.Tests.ps1 index cb7c5af63e..ad6f7176df 100644 --- a/tests/Set-DbaAgReplica.Tests.ps1 +++ b/tests/Set-DbaAgReplica.Tests.ps1 @@ -11,52 +11,52 @@ Describe "Set-DbaAgReplica" { $CommandUnderTest = Get-Command Set-DbaAgReplica } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have Replica as a parameter" { - $CommandUnderTest | Should -HaveParameter Replica -Type System.String + $CommandUnderTest | Should -HaveParameter Replica } It "Should have AvailabilityMode as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityMode -Type System.String + $CommandUnderTest | Should -HaveParameter AvailabilityMode } It "Should have FailoverMode as a parameter" { - $CommandUnderTest | Should -HaveParameter FailoverMode -Type System.String + $CommandUnderTest | Should -HaveParameter FailoverMode } It "Should have BackupPriority as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupPriority -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BackupPriority } It "Should have ConnectionModeInPrimaryRole as a parameter" { - $CommandUnderTest | Should -HaveParameter ConnectionModeInPrimaryRole -Type System.String + $CommandUnderTest | Should -HaveParameter ConnectionModeInPrimaryRole } It "Should have ConnectionModeInSecondaryRole as a parameter" { - $CommandUnderTest | Should -HaveParameter ConnectionModeInSecondaryRole -Type System.String + $CommandUnderTest | Should -HaveParameter ConnectionModeInSecondaryRole } It "Should have SeedingMode as a parameter" { - $CommandUnderTest | Should -HaveParameter SeedingMode -Type System.String + $CommandUnderTest | Should -HaveParameter SeedingMode } It "Should have SessionTimeout as a parameter" { - $CommandUnderTest | Should -HaveParameter SessionTimeout -Type System.Int32 + $CommandUnderTest | Should -HaveParameter SessionTimeout } It "Should have EndpointUrl as a parameter" { - $CommandUnderTest | Should -HaveParameter EndpointUrl -Type System.String + $CommandUnderTest | Should -HaveParameter EndpointUrl } It "Should have ReadonlyRoutingConnectionUrl as a parameter" { - $CommandUnderTest | Should -HaveParameter ReadonlyRoutingConnectionUrl -Type System.String + $CommandUnderTest | Should -HaveParameter ReadonlyRoutingConnectionUrl } It "Should have ReadOnlyRoutingList as a parameter" { - $CommandUnderTest | Should -HaveParameter ReadOnlyRoutingList -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ReadOnlyRoutingList } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityReplica + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaAgentAlert.Tests.ps1 b/tests/Set-DbaAgentAlert.Tests.ps1 index d8186c80ca..e78890e2c1 100644 --- a/tests/Set-DbaAgentAlert.Tests.ps1 +++ b/tests/Set-DbaAgentAlert.Tests.ps1 @@ -6,31 +6,31 @@ Describe "Set-DbaAgentAlert" { $CommandUnderTest = Get-Command Set-DbaAgentAlert } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Alert parameter" { - $CommandUnderTest | Should -HaveParameter Alert -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Alert } It "Should have NewName parameter" { - $CommandUnderTest | Should -HaveParameter NewName -Type System.String + $CommandUnderTest | Should -HaveParameter NewName } It "Should have Enabled parameter" { - $CommandUnderTest | Should -HaveParameter Enabled -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Enabled } It "Should have Disabled parameter" { - $CommandUnderTest | Should -HaveParameter Disabled -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Disabled } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Agent.Alert[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaAgentJob.Tests.ps1 b/tests/Set-DbaAgentJob.Tests.ps1 index 9ab8e5bbea..88fda3bcbc 100644 --- a/tests/Set-DbaAgentJob.Tests.ps1 +++ b/tests/Set-DbaAgentJob.Tests.ps1 @@ -6,73 +6,73 @@ Describe "Set-DbaAgentJob" { $CommandUnderTest = Get-Command Set-DbaAgentJob } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Job as a parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Job } It "Should have Schedule as a parameter" { - $CommandUnderTest | Should -HaveParameter Schedule -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Schedule } It "Should have ScheduleId as a parameter" { - $CommandUnderTest | Should -HaveParameter ScheduleId -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter ScheduleId } It "Should have NewName as a parameter" { - $CommandUnderTest | Should -HaveParameter NewName -Type System.String + $CommandUnderTest | Should -HaveParameter NewName } It "Should have Enabled as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Enabled -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Enabled } It "Should have Disabled as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Disabled -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Disabled } It "Should have Description as a parameter" { - $CommandUnderTest | Should -HaveParameter Description -Type System.String + $CommandUnderTest | Should -HaveParameter Description } It "Should have StartStepId as a parameter" { - $CommandUnderTest | Should -HaveParameter StartStepId -Type System.Int32 + $CommandUnderTest | Should -HaveParameter StartStepId } It "Should have Category as a parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type System.String + $CommandUnderTest | Should -HaveParameter Category } It "Should have OwnerLogin as a parameter" { - $CommandUnderTest | Should -HaveParameter OwnerLogin -Type System.String + $CommandUnderTest | Should -HaveParameter OwnerLogin } It "Should have EventLogLevel as a parameter" { - $CommandUnderTest | Should -HaveParameter EventLogLevel -Type System.Object + $CommandUnderTest | Should -HaveParameter EventLogLevel } It "Should have EmailLevel as a parameter" { - $CommandUnderTest | Should -HaveParameter EmailLevel -Type System.Object + $CommandUnderTest | Should -HaveParameter EmailLevel } It "Should have NetsendLevel as a parameter" { - $CommandUnderTest | Should -HaveParameter NetsendLevel -Type System.Object + $CommandUnderTest | Should -HaveParameter NetsendLevel } It "Should have PageLevel as a parameter" { - $CommandUnderTest | Should -HaveParameter PageLevel -Type System.Object + $CommandUnderTest | Should -HaveParameter PageLevel } It "Should have EmailOperator as a parameter" { - $CommandUnderTest | Should -HaveParameter EmailOperator -Type System.String + $CommandUnderTest | Should -HaveParameter EmailOperator } It "Should have NetsendOperator as a parameter" { - $CommandUnderTest | Should -HaveParameter NetsendOperator -Type System.String + $CommandUnderTest | Should -HaveParameter NetsendOperator } It "Should have PageOperator as a parameter" { - $CommandUnderTest | Should -HaveParameter PageOperator -Type System.String + $CommandUnderTest | Should -HaveParameter PageOperator } It "Should have DeleteLevel as a parameter" { - $CommandUnderTest | Should -HaveParameter DeleteLevel -Type System.Object + $CommandUnderTest | Should -HaveParameter DeleteLevel } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Agent.Job[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Set-DbaAgentJobCategory.Tests.ps1 b/tests/Set-DbaAgentJobCategory.Tests.ps1 index d09eb6ed7e..6a6ce770cd 100644 --- a/tests/Set-DbaAgentJobCategory.Tests.ps1 +++ b/tests/Set-DbaAgentJobCategory.Tests.ps1 @@ -9,22 +9,22 @@ Describe "Set-DbaAgentJobCategory" { $CommandUnderTest = Get-Command Set-DbaAgentJobCategory } It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Category as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Category -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Category } It "Should have NewName as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter NewName -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NewName } It "Should have Force as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaAgentJobOutputFile.Tests.ps1 b/tests/Set-DbaAgentJobOutputFile.Tests.ps1 index 790b4c8b0e..b56125537a 100644 --- a/tests/Set-DbaAgentJobOutputFile.Tests.ps1 +++ b/tests/Set-DbaAgentJobOutputFile.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Set-DbaAgentJobOutputFile" { $CommandUnderTest = Get-Command Set-DbaAgentJobOutputFile } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Job as a parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Job } It "Should have Step as a parameter" { - $CommandUnderTest | Should -HaveParameter Step -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Step } It "Should have OutputFile as a parameter" { - $CommandUnderTest | Should -HaveParameter OutputFile -Type System.String + $CommandUnderTest | Should -HaveParameter OutputFile } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Set-DbaAgentJobOwner.Tests.ps1 b/tests/Set-DbaAgentJobOwner.Tests.ps1 index 0436368657..93edb1b648 100644 --- a/tests/Set-DbaAgentJobOwner.Tests.ps1 +++ b/tests/Set-DbaAgentJobOwner.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Set-DbaAgentJobOwner" { $CommandUnderTest = Get-Command Set-DbaAgentJobOwner } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Job parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Job } It "Should have ExcludeJob parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeJob -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeJob } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Agent.Job[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Login parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String + $CommandUnderTest | Should -HaveParameter Login } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Set-DbaAgentJobStep.Tests.ps1 b/tests/Set-DbaAgentJobStep.Tests.ps1 index cdb4e4d254..448c671b30 100644 --- a/tests/Set-DbaAgentJobStep.Tests.ps1 +++ b/tests/Set-DbaAgentJobStep.Tests.ps1 @@ -24,17 +24,15 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' { @(Compare-Object -ReferenceObject $knownParameters -DifferenceObject $params).Count | Should -Be 0 } - It "Should have SqlInstance parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] and not mandatory" { + It "Should have SqlInstance parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { (Get-Command $CommandName).Parameters['SqlInstance'].ParameterType.FullName | Should -Be 'Dataplat.Dbatools.Parameter.DbaInstanceParameter[]' - (Get-Command $CommandName).Parameters['SqlInstance'].Attributes.Mandatory | Should -Be $false } - It "Should have SqlCredential parameter of type System.Management.Automation.PSCredential and not mandatory" { + It "Should have SqlCredential parameter of type System.Management.Automation.PSCredential" { (Get-Command $CommandName).Parameters['SqlCredential'].ParameterType.FullName | Should -Be 'System.Management.Automation.PSCredential' - (Get-Command $CommandName).Parameters['SqlCredential'].Attributes.Mandatory | Should -Be $false } - # Add similar It blocks for each parameter, checking type and mandatory status + # Add similar It blocks for each parameter, checking type } } diff --git a/tests/Set-DbaAgentOperator.Tests.ps1 b/tests/Set-DbaAgentOperator.Tests.ps1 index d067cde6a3..13c1d92527 100644 --- a/tests/Set-DbaAgentOperator.Tests.ps1 +++ b/tests/Set-DbaAgentOperator.Tests.ps1 @@ -12,58 +12,58 @@ Describe "Set-DbaAgentOperator" { $CommandUnderTest = Get-Command Set-DbaAgentOperator } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Operator as a parameter" { - $CommandUnderTest | Should -HaveParameter Operator -Type System.String[] + $CommandUnderTest | Should -HaveParameter Operator } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String + $CommandUnderTest | Should -HaveParameter Name } It "Should have EmailAddress as a parameter" { - $CommandUnderTest | Should -HaveParameter EmailAddress -Type System.String + $CommandUnderTest | Should -HaveParameter EmailAddress } It "Should have NetSendAddress as a parameter" { - $CommandUnderTest | Should -HaveParameter NetSendAddress -Type System.String + $CommandUnderTest | Should -HaveParameter NetSendAddress } It "Should have PagerAddress as a parameter" { - $CommandUnderTest | Should -HaveParameter PagerAddress -Type System.String + $CommandUnderTest | Should -HaveParameter PagerAddress } It "Should have PagerDay as a parameter" { - $CommandUnderTest | Should -HaveParameter PagerDay -Type System.String + $CommandUnderTest | Should -HaveParameter PagerDay } It "Should have SaturdayStartTime as a parameter" { - $CommandUnderTest | Should -HaveParameter SaturdayStartTime -Type System.String + $CommandUnderTest | Should -HaveParameter SaturdayStartTime } It "Should have SaturdayEndTime as a parameter" { - $CommandUnderTest | Should -HaveParameter SaturdayEndTime -Type System.String + $CommandUnderTest | Should -HaveParameter SaturdayEndTime } It "Should have SundayStartTime as a parameter" { - $CommandUnderTest | Should -HaveParameter SundayStartTime -Type System.String + $CommandUnderTest | Should -HaveParameter SundayStartTime } It "Should have SundayEndTime as a parameter" { - $CommandUnderTest | Should -HaveParameter SundayEndTime -Type System.String + $CommandUnderTest | Should -HaveParameter SundayEndTime } It "Should have WeekdayStartTime as a parameter" { - $CommandUnderTest | Should -HaveParameter WeekdayStartTime -Type System.String + $CommandUnderTest | Should -HaveParameter WeekdayStartTime } It "Should have WeekdayEndTime as a parameter" { - $CommandUnderTest | Should -HaveParameter WeekdayEndTime -Type System.String + $CommandUnderTest | Should -HaveParameter WeekdayEndTime } It "Should have IsFailsafeOperator as a parameter" { - $CommandUnderTest | Should -HaveParameter IsFailsafeOperator -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter IsFailsafeOperator } It "Should have FailsafeNotificationMethod as a parameter" { - $CommandUnderTest | Should -HaveParameter FailsafeNotificationMethod -Type System.String[] + $CommandUnderTest | Should -HaveParameter FailsafeNotificationMethod } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Agent.Operator[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaAgentSchedule.Tests.ps1 b/tests/Set-DbaAgentSchedule.Tests.ps1 index ac6d08800c..321f386de7 100644 --- a/tests/Set-DbaAgentSchedule.Tests.ps1 +++ b/tests/Set-DbaAgentSchedule.Tests.ps1 @@ -10,61 +10,61 @@ Describe "Set-DbaAgentSchedule" { $CommandUnderTest = Get-Command Set-DbaAgentSchedule } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Job parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Job } It "Should have ScheduleName parameter" { - $CommandUnderTest | Should -HaveParameter ScheduleName -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ScheduleName } It "Should have NewName parameter" { - $CommandUnderTest | Should -HaveParameter NewName -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NewName } It "Should have Enabled parameter" { - $CommandUnderTest | Should -HaveParameter Enabled -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Enabled } It "Should have Disabled parameter" { - $CommandUnderTest | Should -HaveParameter Disabled -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Disabled } It "Should have FrequencyType parameter" { - $CommandUnderTest | Should -HaveParameter FrequencyType -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FrequencyType } It "Should have FrequencyInterval parameter" { - $CommandUnderTest | Should -HaveParameter FrequencyInterval -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FrequencyInterval } It "Should have FrequencySubdayType parameter" { - $CommandUnderTest | Should -HaveParameter FrequencySubdayType -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FrequencySubdayType } It "Should have FrequencySubdayInterval parameter" { - $CommandUnderTest | Should -HaveParameter FrequencySubdayInterval -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FrequencySubdayInterval } It "Should have FrequencyRelativeInterval parameter" { - $CommandUnderTest | Should -HaveParameter FrequencyRelativeInterval -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FrequencyRelativeInterval } It "Should have FrequencyRecurrenceFactor parameter" { - $CommandUnderTest | Should -HaveParameter FrequencyRecurrenceFactor -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FrequencyRecurrenceFactor } It "Should have StartDate parameter" { - $CommandUnderTest | Should -HaveParameter StartDate -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter StartDate } It "Should have EndDate parameter" { - $CommandUnderTest | Should -HaveParameter EndDate -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EndDate } It "Should have StartTime parameter" { - $CommandUnderTest | Should -HaveParameter StartTime -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter StartTime } It "Should have EndTime parameter" { - $CommandUnderTest | Should -HaveParameter EndTime -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EndTime } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } } diff --git a/tests/Set-DbaAgentServer.Tests.ps1 b/tests/Set-DbaAgentServer.Tests.ps1 index b77bdd77db..d21532d5a3 100644 --- a/tests/Set-DbaAgentServer.Tests.ps1 +++ b/tests/Set-DbaAgentServer.Tests.ps1 @@ -22,76 +22,76 @@ Describe "Set-DbaAgentServer" { $CommandUnderTest = Get-Command Set-DbaAgentServer } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Agent.JobServer[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have AgentLogLevel as a parameter" { - $CommandUnderTest | Should -HaveParameter AgentLogLevel -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AgentLogLevel } It "Should have AgentMailType as a parameter" { - $CommandUnderTest | Should -HaveParameter AgentMailType -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AgentMailType } It "Should have AgentShutdownWaitTime as a parameter" { - $CommandUnderTest | Should -HaveParameter AgentShutdownWaitTime -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AgentShutdownWaitTime } It "Should have DatabaseMailProfile as a parameter" { - $CommandUnderTest | Should -HaveParameter DatabaseMailProfile -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DatabaseMailProfile } It "Should have ErrorLogFile as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorLogFile -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ErrorLogFile } It "Should have IdleCpuDuration as a parameter" { - $CommandUnderTest | Should -HaveParameter IdleCpuDuration -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IdleCpuDuration } It "Should have IdleCpuPercentage as a parameter" { - $CommandUnderTest | Should -HaveParameter IdleCpuPercentage -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IdleCpuPercentage } It "Should have CpuPolling as a parameter" { - $CommandUnderTest | Should -HaveParameter CpuPolling -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CpuPolling } It "Should have LocalHostAlias as a parameter" { - $CommandUnderTest | Should -HaveParameter LocalHostAlias -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LocalHostAlias } It "Should have LoginTimeout as a parameter" { - $CommandUnderTest | Should -HaveParameter LoginTimeout -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LoginTimeout } It "Should have MaximumHistoryRows as a parameter" { - $CommandUnderTest | Should -HaveParameter MaximumHistoryRows -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaximumHistoryRows } It "Should have MaximumJobHistoryRows as a parameter" { - $CommandUnderTest | Should -HaveParameter MaximumJobHistoryRows -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaximumJobHistoryRows } It "Should have NetSendRecipient as a parameter" { - $CommandUnderTest | Should -HaveParameter NetSendRecipient -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NetSendRecipient } It "Should have ReplaceAlertTokens as a parameter" { - $CommandUnderTest | Should -HaveParameter ReplaceAlertTokens -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ReplaceAlertTokens } It "Should have SaveInSentFolder as a parameter" { - $CommandUnderTest | Should -HaveParameter SaveInSentFolder -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SaveInSentFolder } It "Should have SqlAgentAutoStart as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlAgentAutoStart -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlAgentAutoStart } It "Should have SqlAgentMailProfile as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlAgentMailProfile -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlAgentMailProfile } It "Should have SqlAgentRestart as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlAgentRestart -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlAgentRestart } It "Should have SqlServerRestart as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlServerRestart -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlServerRestart } It "Should have WriteOemErrorLog as a parameter" { - $CommandUnderTest | Should -HaveParameter WriteOemErrorLog -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WriteOemErrorLog } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaAvailabilityGroup.Tests.ps1 b/tests/Set-DbaAvailabilityGroup.Tests.ps1 index 19355ef6c8..fa1e2c7c92 100644 --- a/tests/Set-DbaAvailabilityGroup.Tests.ps1 +++ b/tests/Set-DbaAvailabilityGroup.Tests.ps1 @@ -6,46 +6,46 @@ Describe "Set-DbaAvailabilityGroup" { $CommandUnderTest = Get-Command Set-DbaAvailabilityGroup } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String[] + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have AllAvailabilityGroups as a switch parameter" { - $CommandUnderTest | Should -HaveParameter AllAvailabilityGroups -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AllAvailabilityGroups } It "Should have DtcSupportEnabled as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DtcSupportEnabled -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DtcSupportEnabled } It "Should have ClusterType as a parameter" { - $CommandUnderTest | Should -HaveParameter ClusterType -Type System.String + $CommandUnderTest | Should -HaveParameter ClusterType } It "Should have AutomatedBackupPreference as a parameter" { - $CommandUnderTest | Should -HaveParameter AutomatedBackupPreference -Type System.String + $CommandUnderTest | Should -HaveParameter AutomatedBackupPreference } It "Should have FailureConditionLevel as a parameter" { - $CommandUnderTest | Should -HaveParameter FailureConditionLevel -Type System.String + $CommandUnderTest | Should -HaveParameter FailureConditionLevel } It "Should have HealthCheckTimeout as a parameter" { - $CommandUnderTest | Should -HaveParameter HealthCheckTimeout -Type System.Int32 + $CommandUnderTest | Should -HaveParameter HealthCheckTimeout } It "Should have BasicAvailabilityGroup as a switch parameter" { - $CommandUnderTest | Should -HaveParameter BasicAvailabilityGroup -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter BasicAvailabilityGroup } It "Should have DatabaseHealthTrigger as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DatabaseHealthTrigger -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DatabaseHealthTrigger } It "Should have IsDistributedAvailabilityGroup as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IsDistributedAvailabilityGroup -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IsDistributedAvailabilityGroup } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityGroup[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } @@ -66,13 +66,13 @@ Describe "Set-DbaAvailabilityGroup Integration Tests" -Tag "IntegrationTests" { Context "Sets AG properties" { It "Returns modified results" { - $results = Set-DbaAvailabilityGroup -SqlInstance $global:instance3 -AvailabilityGroup $agname -Confirm:$false -DtcSupportEnabled:$false + $results = Set-DbaAvailabilityGroup -SqlInstance $global:instance3 -AvailabilityGroup $agname -DtcSupportEnabled:$false $results.AvailabilityGroup | Should -Be $agname $results.DtcSupportEnabled | Should -Be $false } It "Returns newly modified results" { - $results = Set-DbaAvailabilityGroup -SqlInstance $global:instance3 -AvailabilityGroup $agname -Confirm:$false -DtcSupportEnabled + $results = Set-DbaAvailabilityGroup -SqlInstance $global:instance3 -AvailabilityGroup $agname -DtcSupportEnabled $results.AvailabilityGroup | Should -Be $agname $results.DtcSupportEnabled | Should -Be $true } diff --git a/tests/Set-DbaCmConnection.Tests.ps1 b/tests/Set-DbaCmConnection.Tests.ps1 index 8d3477576c..edbb1afd5a 100644 --- a/tests/Set-DbaCmConnection.Tests.ps1 +++ b/tests/Set-DbaCmConnection.Tests.ps1 @@ -6,67 +6,67 @@ Describe "Set-DbaCmConnection" { $CommandUnderTest = Get-Command Set-DbaCmConnection } It "Should have ComputerName parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaCmConnectionParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have UseWindowsCredentials parameter" { - $CommandUnderTest | Should -HaveParameter UseWindowsCredentials -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter UseWindowsCredentials } It "Should have OverrideExplicitCredential parameter" { - $CommandUnderTest | Should -HaveParameter OverrideExplicitCredential -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OverrideExplicitCredential } It "Should have OverrideConnectionPolicy parameter" { - $CommandUnderTest | Should -HaveParameter OverrideConnectionPolicy -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OverrideConnectionPolicy } It "Should have DisabledConnectionTypes parameter" { - $CommandUnderTest | Should -HaveParameter DisabledConnectionTypes -Type Dataplat.Dbatools.Connection.ManagementConnectionType -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DisabledConnectionTypes } It "Should have DisableBadCredentialCache parameter" { - $CommandUnderTest | Should -HaveParameter DisableBadCredentialCache -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DisableBadCredentialCache } It "Should have DisableCimPersistence parameter" { - $CommandUnderTest | Should -HaveParameter DisableCimPersistence -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DisableCimPersistence } It "Should have DisableCredentialAutoRegister parameter" { - $CommandUnderTest | Should -HaveParameter DisableCredentialAutoRegister -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DisableCredentialAutoRegister } It "Should have EnableCredentialFailover parameter" { - $CommandUnderTest | Should -HaveParameter EnableCredentialFailover -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableCredentialFailover } It "Should have WindowsCredentialsAreBad parameter" { - $CommandUnderTest | Should -HaveParameter WindowsCredentialsAreBad -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WindowsCredentialsAreBad } It "Should have CimWinRMOptions parameter" { - $CommandUnderTest | Should -HaveParameter CimWinRMOptions -Type Microsoft.Management.Infrastructure.Options.WSManSessionOptions -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CimWinRMOptions } It "Should have CimDCOMOptions parameter" { - $CommandUnderTest | Should -HaveParameter CimDCOMOptions -Type Microsoft.Management.Infrastructure.Options.DComSessionOptions -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CimDCOMOptions } It "Should have AddBadCredential parameter" { - $CommandUnderTest | Should -HaveParameter AddBadCredential -Type System.Management.Automation.PSCredential[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AddBadCredential } It "Should have RemoveBadCredential parameter" { - $CommandUnderTest | Should -HaveParameter RemoveBadCredential -Type System.Management.Automation.PSCredential[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter RemoveBadCredential } It "Should have ClearBadCredential parameter" { - $CommandUnderTest | Should -HaveParameter ClearBadCredential -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ClearBadCredential } It "Should have ClearCredential parameter" { - $CommandUnderTest | Should -HaveParameter ClearCredential -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ClearCredential } It "Should have ResetCredential parameter" { - $CommandUnderTest | Should -HaveParameter ResetCredential -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ResetCredential } It "Should have ResetConnectionStatus parameter" { - $CommandUnderTest | Should -HaveParameter ResetConnectionStatus -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ResetConnectionStatus } It "Should have ResetConfiguration parameter" { - $CommandUnderTest | Should -HaveParameter ResetConfiguration -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ResetConfiguration } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Set-DbaDbCompatibility.Tests.ps1 b/tests/Set-DbaDbCompatibility.Tests.ps1 index c10c7f81e4..a95447165e 100644 --- a/tests/Set-DbaDbCompatibility.Tests.ps1 +++ b/tests/Set-DbaDbCompatibility.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Set-DbaDbCompatibility" { $CommandUnderTest = Get-Command Set-DbaDbCompatibility } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Compatibility parameter" { - $CommandUnderTest | Should -HaveParameter Compatibility -Type Microsoft.SqlServer.Management.Smo.CompatibilityLevel + $CommandUnderTest | Should -HaveParameter Compatibility } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -36,7 +36,7 @@ Describe "Set-DbaDbCompatibility" { $dbNameNotMatches = "dbatoolscliCompatibilityLevelNotMatch_$(Get-Random -Minimum 600 -Maximum 1100)" $instanceLevel = $sqlCn.Databases['master'].CompatibilityLevel $previousCompatLevel = [int]($instanceLevel.ToString().Trim('Version')) - 10 - Get-DbaProcess -SqlInstance $global:instance2 -Database model | Stop-DbaProcess -Confirm:$false + Get-DbaProcess -SqlInstance $global:instance2 -Database model | Stop-DbaProcess $queryNot = "CREATE DATABASE $dbNameNotMatches" $sqlCn.Query($queryNot) Start-Sleep 5 @@ -49,7 +49,7 @@ Describe "Set-DbaDbCompatibility" { AfterAll { $sqlCn = Connect-DbaInstance -SqlInstance $global:instance2 - Remove-DbaDatabase -SqlInstance $sqlCn -Database $dbNameNotMatches -Confirm:$false + Remove-DbaDatabase -SqlInstance $sqlCn -Database $dbNameNotMatches $sqlCn.ConnectionContext.Disconnect() } diff --git a/tests/Set-DbaDbCompression.Tests.ps1 b/tests/Set-DbaDbCompression.Tests.ps1 index 12c0e3e085..baf1ef0ab1 100644 --- a/tests/Set-DbaDbCompression.Tests.ps1 +++ b/tests/Set-DbaDbCompression.Tests.ps1 @@ -25,37 +25,37 @@ Describe "Set-DbaDbCompression" { $CommandUnderTest = Get-Command Set-DbaDbCompression } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Table as a parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] + $CommandUnderTest | Should -HaveParameter Table } It "Should have CompressionType as a parameter" { - $CommandUnderTest | Should -HaveParameter CompressionType -Type System.String + $CommandUnderTest | Should -HaveParameter CompressionType } It "Should have MaxRunTime as a parameter" { - $CommandUnderTest | Should -HaveParameter MaxRunTime -Type Int32 + $CommandUnderTest | Should -HaveParameter MaxRunTime } It "Should have PercentCompression as a parameter" { - $CommandUnderTest | Should -HaveParameter PercentCompression -Type Int32 + $CommandUnderTest | Should -HaveParameter PercentCompression } It "Should have ForceOfflineRebuilds as a parameter" { - $CommandUnderTest | Should -HaveParameter ForceOfflineRebuilds -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ForceOfflineRebuilds } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaDbFileGroup.Tests.ps1 b/tests/Set-DbaDbFileGroup.Tests.ps1 index b748d52feb..a1a468ab58 100644 --- a/tests/Set-DbaDbFileGroup.Tests.ps1 +++ b/tests/Set-DbaDbFileGroup.Tests.ps1 @@ -31,31 +31,31 @@ Describe "Set-DbaDbFileGroup" { $CommandUnderTest = Get-Command Set-DbaDbFileGroup } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have FileGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter FileGroup -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FileGroup } It "Should have Default as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Default -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Default } It "Should have ReadOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ReadOnly -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ReadOnly } It "Should have AutoGrowAllFiles as a switch parameter" { - $CommandUnderTest | Should -HaveParameter AutoGrowAllFiles -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AutoGrowAllFiles } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaDbFileGrowth.Tests.ps1 b/tests/Set-DbaDbFileGrowth.Tests.ps1 index 9f22426728..b08e135868 100644 --- a/tests/Set-DbaDbFileGrowth.Tests.ps1 +++ b/tests/Set-DbaDbFileGrowth.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Set-DbaDbFileGrowth" { $CommandUnderTest = Get-Command Set-DbaDbFileGrowth } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have GrowthType as a parameter" { - $CommandUnderTest | Should -HaveParameter GrowthType -Type System.String + $CommandUnderTest | Should -HaveParameter GrowthType } It "Should have Growth as a parameter" { - $CommandUnderTest | Should -HaveParameter Growth -Type System.Int32 + $CommandUnderTest | Should -HaveParameter Growth } It "Should have FileType as a parameter" { - $CommandUnderTest | Should -HaveParameter FileType -Type System.String + $CommandUnderTest | Should -HaveParameter FileType } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Set-DbaDbIdentity.Tests.ps1 b/tests/Set-DbaDbIdentity.Tests.ps1 index 78435eca6a..4efb7bd1c1 100644 --- a/tests/Set-DbaDbIdentity.Tests.ps1 +++ b/tests/Set-DbaDbIdentity.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Set-DbaDbIdentity" { $CommandUnderTest = Get-Command Set-DbaDbIdentity } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Table as a parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] + $CommandUnderTest | Should -HaveParameter Table } It "Should have ReSeedValue as a parameter" { - $CommandUnderTest | Should -HaveParameter ReSeedValue -Type System.Int32 + $CommandUnderTest | Should -HaveParameter ReSeedValue } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaDbMirror.Tests.ps1 b/tests/Set-DbaDbMirror.Tests.ps1 index f54e8cde55..fd47ab47de 100644 --- a/tests/Set-DbaDbMirror.Tests.ps1 +++ b/tests/Set-DbaDbMirror.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Set-DbaDbMirror" { $CommandUnderTest = Get-Command Set-DbaDbMirror } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Partner parameter" { - $CommandUnderTest | Should -HaveParameter Partner -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Partner } It "Should have Witness parameter" { - $CommandUnderTest | Should -HaveParameter Witness -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Witness } It "Should have SafetyLevel parameter" { - $CommandUnderTest | Should -HaveParameter SafetyLevel -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SafetyLevel } It "Should have State parameter" { - $CommandUnderTest | Should -HaveParameter State -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter State } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Set-DbaDbOwner.Tests.ps1 b/tests/Set-DbaDbOwner.Tests.ps1 index 8ce721d26e..eb0c67105d 100644 --- a/tests/Set-DbaDbOwner.Tests.ps1 +++ b/tests/Set-DbaDbOwner.Tests.ps1 @@ -12,25 +12,25 @@ Describe "Set-DbaDbOwner Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Set-DbaDbOwner } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have TargetLogin parameter" { - $CommandUnderTest | Should -HaveParameter TargetLogin -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter TargetLogin } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Set-DbaDbQueryStoreOption.Tests.ps1 b/tests/Set-DbaDbQueryStoreOption.Tests.ps1 index 2927b45ca6..bdef3a418a 100644 --- a/tests/Set-DbaDbQueryStoreOption.Tests.ps1 +++ b/tests/Set-DbaDbQueryStoreOption.Tests.ps1 @@ -12,61 +12,61 @@ Describe "Set-DbaDbQueryStoreOption" { $CommandUnderTest = Get-Command Set-DbaDbQueryStoreOption } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have AllDatabases parameter" { - $CommandUnderTest | Should -HaveParameter AllDatabases -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AllDatabases } It "Should have State parameter" { - $CommandUnderTest | Should -HaveParameter State -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter State } It "Should have FlushInterval parameter" { - $CommandUnderTest | Should -HaveParameter FlushInterval -Type System.Int64 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FlushInterval } It "Should have CollectionInterval parameter" { - $CommandUnderTest | Should -HaveParameter CollectionInterval -Type System.Int64 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CollectionInterval } It "Should have MaxSize parameter" { - $CommandUnderTest | Should -HaveParameter MaxSize -Type System.Int64 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaxSize } It "Should have CaptureMode parameter" { - $CommandUnderTest | Should -HaveParameter CaptureMode -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CaptureMode } It "Should have CleanupMode parameter" { - $CommandUnderTest | Should -HaveParameter CleanupMode -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CleanupMode } It "Should have StaleQueryThreshold parameter" { - $CommandUnderTest | Should -HaveParameter StaleQueryThreshold -Type System.Int64 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter StaleQueryThreshold } It "Should have MaxPlansPerQuery parameter" { - $CommandUnderTest | Should -HaveParameter MaxPlansPerQuery -Type System.Int64 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaxPlansPerQuery } It "Should have WaitStatsCaptureMode parameter" { - $CommandUnderTest | Should -HaveParameter WaitStatsCaptureMode -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WaitStatsCaptureMode } It "Should have CustomCapturePolicyExecutionCount parameter" { - $CommandUnderTest | Should -HaveParameter CustomCapturePolicyExecutionCount -Type System.Int64 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CustomCapturePolicyExecutionCount } It "Should have CustomCapturePolicyTotalCompileCPUTimeMS parameter" { - $CommandUnderTest | Should -HaveParameter CustomCapturePolicyTotalCompileCPUTimeMS -Type System.Int64 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CustomCapturePolicyTotalCompileCPUTimeMS } It "Should have CustomCapturePolicyTotalExecutionCPUTimeMS parameter" { - $CommandUnderTest | Should -HaveParameter CustomCapturePolicyTotalExecutionCPUTimeMS -Type System.Int64 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CustomCapturePolicyTotalExecutionCPUTimeMS } It "Should have CustomCapturePolicyStaleThresholdHours parameter" { - $CommandUnderTest | Should -HaveParameter CustomCapturePolicyStaleThresholdHours -Type System.Int64 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CustomCapturePolicyStaleThresholdHours } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaDbRecoveryModel.Tests.ps1 b/tests/Set-DbaDbRecoveryModel.Tests.ps1 index 679723abf8..0d8ea8b098 100644 --- a/tests/Set-DbaDbRecoveryModel.Tests.ps1 +++ b/tests/Set-DbaDbRecoveryModel.Tests.ps1 @@ -10,28 +10,28 @@ Describe "Set-DbaDbRecoveryModel" { $CommandUnderTest = Get-Command Set-DbaDbRecoveryModel } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have RecoveryModel parameter" { - $CommandUnderTest | Should -HaveParameter RecoveryModel -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter RecoveryModel } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have AllDatabases parameter" { - $CommandUnderTest | Should -HaveParameter AllDatabases -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AllDatabases } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } } diff --git a/tests/Set-DbaDbSchema.Tests.ps1 b/tests/Set-DbaDbSchema.Tests.ps1 index 94f42c695b..5297756ee5 100644 --- a/tests/Set-DbaDbSchema.Tests.ps1 +++ b/tests/Set-DbaDbSchema.Tests.ps1 @@ -33,25 +33,25 @@ Describe "Set-DbaDbSchema" { $CommandUnderTest = Get-Command Set-DbaDbSchema } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String[] + $CommandUnderTest | Should -HaveParameter Schema } It "Should have SchemaOwner as a parameter" { - $CommandUnderTest | Should -HaveParameter SchemaOwner -Type System.String + $CommandUnderTest | Should -HaveParameter SchemaOwner } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaDbSequence.Tests.ps1 b/tests/Set-DbaDbSequence.Tests.ps1 index 151f1dcb25..b8e0faf63b 100644 --- a/tests/Set-DbaDbSequence.Tests.ps1 +++ b/tests/Set-DbaDbSequence.Tests.ps1 @@ -6,43 +6,43 @@ Describe "Set-DbaDbSequence" { $CommandUnderTest = Get-Command Set-DbaDbSequence } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Sequence as a parameter" { - $CommandUnderTest | Should -HaveParameter Sequence -Type System.String[] + $CommandUnderTest | Should -HaveParameter Sequence } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String + $CommandUnderTest | Should -HaveParameter Schema } It "Should have RestartWith as a parameter" { - $CommandUnderTest | Should -HaveParameter RestartWith -Type System.Int64 + $CommandUnderTest | Should -HaveParameter RestartWith } It "Should have IncrementBy as a parameter" { - $CommandUnderTest | Should -HaveParameter IncrementBy -Type System.Int64 + $CommandUnderTest | Should -HaveParameter IncrementBy } It "Should have MinValue as a parameter" { - $CommandUnderTest | Should -HaveParameter MinValue -Type System.Int64 + $CommandUnderTest | Should -HaveParameter MinValue } It "Should have MaxValue as a parameter" { - $CommandUnderTest | Should -HaveParameter MaxValue -Type System.Int64 + $CommandUnderTest | Should -HaveParameter MaxValue } It "Should have Cycle as a parameter" { - $CommandUnderTest | Should -HaveParameter Cycle -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Cycle } It "Should have CacheSize as a parameter" { - $CommandUnderTest | Should -HaveParameter CacheSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter CacheSize } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -62,7 +62,7 @@ Describe "Set-DbaDbSequence" { } It "validates required Database param" { - $sequence = Set-DbaDbSequence -SqlInstance $server -Sequence "Sequence1_$random" -Schema "Schema_$random" -Confirm:$false -ErrorVariable error + $sequence = Set-DbaDbSequence -SqlInstance $server -Sequence "Sequence1_$random" -Schema "Schema_$random" -ErrorVariable error $sequence | Should -BeNullOrEmpty $error | Should -Match "Database is required when SqlInstance is specified" } diff --git a/tests/Set-DbaDbState.Tests.ps1 b/tests/Set-DbaDbState.Tests.ps1 index 251920b35d..0a3df2597f 100644 --- a/tests/Set-DbaDbState.Tests.ps1 +++ b/tests/Set-DbaDbState.Tests.ps1 @@ -11,55 +11,55 @@ Describe "Set-DbaDbState Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Set-DbaDbState } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have AllDatabases as a switch parameter" { - $CommandUnderTest | Should -HaveParameter AllDatabases -Type switch + $CommandUnderTest | Should -HaveParameter AllDatabases } It "Should have ReadOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ReadOnly -Type switch + $CommandUnderTest | Should -HaveParameter ReadOnly } It "Should have ReadWrite as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ReadWrite -Type switch + $CommandUnderTest | Should -HaveParameter ReadWrite } It "Should have Online as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Online -Type switch + $CommandUnderTest | Should -HaveParameter Online } It "Should have Offline as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Offline -Type switch + $CommandUnderTest | Should -HaveParameter Offline } It "Should have Emergency as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Emergency -Type switch + $CommandUnderTest | Should -HaveParameter Emergency } It "Should have Detached as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Detached -Type switch + $CommandUnderTest | Should -HaveParameter Detached } It "Should have SingleUser as a switch parameter" { - $CommandUnderTest | Should -HaveParameter SingleUser -Type switch + $CommandUnderTest | Should -HaveParameter SingleUser } It "Should have RestrictedUser as a switch parameter" { - $CommandUnderTest | Should -HaveParameter RestrictedUser -Type switch + $CommandUnderTest | Should -HaveParameter RestrictedUser } It "Should have MultiUser as a switch parameter" { - $CommandUnderTest | Should -HaveParameter MultiUser -Type switch + $CommandUnderTest | Should -HaveParameter MultiUser } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type switch + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Management.Automation.PSObject[] + $CommandUnderTest | Should -HaveParameter InputObject } } } diff --git a/tests/Set-DbaDefaultPath.Tests.ps1 b/tests/Set-DbaDefaultPath.Tests.ps1 index 74c1b2591a..614210ce0b 100644 --- a/tests/Set-DbaDefaultPath.Tests.ps1 +++ b/tests/Set-DbaDefaultPath.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Set-DbaDefaultPath" { $CommandUnderTest = Get-Command Set-DbaDefaultPath } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Type as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type } It "Should have Path as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Path } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaEndpoint.Tests.ps1 b/tests/Set-DbaEndpoint.Tests.ps1 index 3a0ce326e5..a9e04ddd54 100644 --- a/tests/Set-DbaEndpoint.Tests.ps1 +++ b/tests/Set-DbaEndpoint.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Set-DbaEndpoint" { $CommandUnderTest = Get-Command Set-DbaEndpoint } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Endpoint parameter" { - $CommandUnderTest | Should -HaveParameter Endpoint -Type System.String[] + $CommandUnderTest | Should -HaveParameter Endpoint } It "Should have Owner parameter" { - $CommandUnderTest | Should -HaveParameter Owner -Type System.String + $CommandUnderTest | Should -HaveParameter Owner } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String + $CommandUnderTest | Should -HaveParameter Type } It "Should have AllEndpoints parameter" { - $CommandUnderTest | Should -HaveParameter AllEndpoints -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AllEndpoints } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Endpoint[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Set-DbaErrorLogConfig.Tests.ps1 b/tests/Set-DbaErrorLogConfig.Tests.ps1 index a707d8aa73..557150b026 100644 --- a/tests/Set-DbaErrorLogConfig.Tests.ps1 +++ b/tests/Set-DbaErrorLogConfig.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Set-DbaErrorLogConfig" { $CommandUnderTest = Get-Command Set-DbaErrorLogConfig } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have LogCount as a parameter" { - $CommandUnderTest | Should -HaveParameter LogCount -Type System.Int32 + $CommandUnderTest | Should -HaveParameter LogCount } It "Should have LogSize as a parameter" { - $CommandUnderTest | Should -HaveParameter LogSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter LogSize } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaExtendedProperty.Tests.ps1 b/tests/Set-DbaExtendedProperty.Tests.ps1 index 78e888ab11..81108c2393 100644 --- a/tests/Set-DbaExtendedProperty.Tests.ps1 +++ b/tests/Set-DbaExtendedProperty.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Set-DbaExtendedProperty" { $CommandUnderTest = Get-Command Set-DbaExtendedProperty } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type ExtendedProperty[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Value as a parameter" { - $CommandUnderTest | Should -HaveParameter Value -Type System.String + $CommandUnderTest | Should -HaveParameter Value } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter WhatIf } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Confirm } } } @@ -27,14 +27,14 @@ Describe "Set-DbaExtendedProperty Integration Tests" -Tag "IntegrationTests" { BeforeAll { $random = Get-Random $instance2 = Connect-DbaInstance -SqlInstance $global:instance2 - $null = Get-DbaProcess -SqlInstance $instance2 | Where-Object Program -match dbatools | Stop-DbaProcess -Confirm:$false + $null = Get-DbaProcess -SqlInstance $instance2 | Where-Object Program -match dbatools | Stop-DbaProcess $newDbName = "dbatoolsci_newdb_$random" $db = New-DbaDatabase -SqlInstance $instance2 -Name $newDbName $db | Add-DbaExtendedProperty -Name "Test_Database_Name" -Value $newDbName } AfterAll { - $null = $db | Remove-DbaDatabase -Confirm:$false + $null = $db | Remove-DbaDatabase } Context "commands work as expected" { diff --git a/tests/Set-DbaExtendedProtection.Tests.ps1 b/tests/Set-DbaExtendedProtection.Tests.ps1 index 67f6ae6516..e4718d2ecf 100644 --- a/tests/Set-DbaExtendedProtection.Tests.ps1 +++ b/tests/Set-DbaExtendedProtection.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Set-DbaExtendedProtection" { $CommandUnderTest = Get-Command Set-DbaExtendedProtection } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Microsoft.SqlServer.Management.Smo.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Value as a parameter" { - $CommandUnderTest | Should -HaveParameter Value -Type System.Object + $CommandUnderTest | Should -HaveParameter Value } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaLogin.Tests.ps1 b/tests/Set-DbaLogin.Tests.ps1 index ffbef82c20..73ce8c523e 100644 --- a/tests/Set-DbaLogin.Tests.ps1 +++ b/tests/Set-DbaLogin.Tests.ps1 @@ -30,25 +30,25 @@ Describe "Set-DbaLogin" { } It "Should have the correct parameters" { - $command | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false - $command | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false - $command | Should -HaveParameter Login -Type System.String[] -Mandatory:$false - $command | Should -HaveParameter SecurePassword -Type System.Object -Mandatory:$false - $command | Should -HaveParameter DefaultDatabase -Type System.String -Mandatory:$false - $command | Should -HaveParameter Unlock -Type System.Management.Automation.SwitchParameter -Mandatory:$false - $command | Should -HaveParameter PasswordMustChange -Type System.Management.Automation.SwitchParameter -Mandatory:$false - $command | Should -HaveParameter NewName -Type System.String -Mandatory:$false - $command | Should -HaveParameter Disable -Type System.Management.Automation.SwitchParameter -Mandatory:$false - $command | Should -HaveParameter Enable -Type System.Management.Automation.SwitchParameter -Mandatory:$false - $command | Should -HaveParameter DenyLogin -Type System.Management.Automation.SwitchParameter -Mandatory:$false - $command | Should -HaveParameter GrantLogin -Type System.Management.Automation.SwitchParameter -Mandatory:$false - $command | Should -HaveParameter PasswordPolicyEnforced -Type System.Management.Automation.SwitchParameter -Mandatory:$false - $command | Should -HaveParameter PasswordExpirationEnabled -Type System.Management.Automation.SwitchParameter -Mandatory:$false - $command | Should -HaveParameter AddRole -Type System.String[] -Mandatory:$false - $command | Should -HaveParameter RemoveRole -Type System.String[] -Mandatory:$false - $command | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Login[] -Mandatory:$false - $command | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false - $command | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $command | Should -HaveParameter SqlInstance + $command | Should -HaveParameter SqlCredential + $command | Should -HaveParameter Login + $command | Should -HaveParameter SecurePassword + $command | Should -HaveParameter DefaultDatabase + $command | Should -HaveParameter Unlock + $command | Should -HaveParameter PasswordMustChange + $command | Should -HaveParameter NewName + $command | Should -HaveParameter Disable + $command | Should -HaveParameter Enable + $command | Should -HaveParameter DenyLogin + $command | Should -HaveParameter GrantLogin + $command | Should -HaveParameter PasswordPolicyEnforced + $command | Should -HaveParameter PasswordExpirationEnabled + $command | Should -HaveParameter AddRole + $command | Should -HaveParameter RemoveRole + $command | Should -HaveParameter InputObject + $command | Should -HaveParameter Force + $command | Should -HaveParameter EnableException } It "Validates -AddRole contains <_>" -ForEach $systemRoles { diff --git a/tests/Set-DbaMaxDop.Tests.ps1 b/tests/Set-DbaMaxDop.Tests.ps1 index e7b2c781ad..80ffbd7395 100644 --- a/tests/Set-DbaMaxDop.Tests.ps1 +++ b/tests/Set-DbaMaxDop.Tests.ps1 @@ -14,28 +14,28 @@ Describe "Set-DbaMaxDop" { $CommandUnderTest = Get-Command Set-DbaMaxDop } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have MaxDop parameter" { - $CommandUnderTest | Should -HaveParameter MaxDop -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaxDop } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Management.Automation.PSObject -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have AllDatabases parameter" { - $CommandUnderTest | Should -HaveParameter AllDatabases -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AllDatabases } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaMaxMemory.Tests.ps1 b/tests/Set-DbaMaxMemory.Tests.ps1 index 243f0fe21a..a3d6f3a21d 100644 --- a/tests/Set-DbaMaxMemory.Tests.ps1 +++ b/tests/Set-DbaMaxMemory.Tests.ps1 @@ -20,19 +20,19 @@ Describe "Set-DbaMaxMemory" { $CommandUnderTest = Get-Command Set-DbaMaxMemory } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Max parameter" { - $CommandUnderTest | Should -HaveParameter Max -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Max } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Management.Automation.PSObject[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaNetworkCertificate.Tests.ps1 b/tests/Set-DbaNetworkCertificate.Tests.ps1 index 495ad62450..2a6fcdd6a3 100644 --- a/tests/Set-DbaNetworkCertificate.Tests.ps1 +++ b/tests/Set-DbaNetworkCertificate.Tests.ps1 @@ -10,22 +10,22 @@ Describe "Set-DbaNetworkCertificate" { $CommandUnderTest = Get-Command Set-DbaNetworkCertificate } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Certificate as a parameter" { - $CommandUnderTest | Should -HaveParameter Certificate -Type System.Security.Cryptography.X509Certificates.X509Certificate2 + $CommandUnderTest | Should -HaveParameter Certificate } It "Should have Thumbprint as a parameter" { - $CommandUnderTest | Should -HaveParameter Thumbprint -Type System.String + $CommandUnderTest | Should -HaveParameter Thumbprint } It "Should have RestartService as a switch parameter" { - $CommandUnderTest | Should -HaveParameter RestartService -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter RestartService } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaNetworkConfiguration.Tests.ps1 b/tests/Set-DbaNetworkConfiguration.Tests.ps1 index 878b0670f1..87d4cf8720 100644 --- a/tests/Set-DbaNetworkConfiguration.Tests.ps1 +++ b/tests/Set-DbaNetworkConfiguration.Tests.ps1 @@ -9,35 +9,35 @@ Describe "Set-DbaNetworkConfiguration" { BeforeAll { $CommandUnderTest = Get-Command Set-DbaNetworkConfiguration } - It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } - It "Should have EnableProtocol as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter EnableProtocol -Type System.String -Mandatory:$false + It "Should have EnableProtocol as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter EnableProtocol } - It "Should have DisableProtocol as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter DisableProtocol -Type System.String -Mandatory:$false + It "Should have DisableProtocol as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter DisableProtocol } It "Should have DynamicPortForIPAll as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter DynamicPortForIPAll -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DynamicPortForIPAll } - It "Should have StaticPortForIPAll as a non-mandatory parameter of type System.Int32[]" { - $CommandUnderTest | Should -HaveParameter StaticPortForIPAll -Type System.Int32[] -Mandatory:$false + It "Should have StaticPortForIPAll as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter StaticPortForIPAll } - It "Should have IpAddress as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter IpAddress -Type System.String[] -Mandatory:$false + It "Should have IpAddress as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter IpAddress } It "Should have RestartService as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter RestartService -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter RestartService } - It "Should have InputObject as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaPowerPlan.Tests.ps1 b/tests/Set-DbaPowerPlan.Tests.ps1 index 6dd6992820..f963120ea4 100644 --- a/tests/Set-DbaPowerPlan.Tests.ps1 +++ b/tests/Set-DbaPowerPlan.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Set-DbaPowerPlan" { $CommandUnderTest = Get-Command Set-DbaPowerPlan } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have PowerPlan as a parameter" { - $CommandUnderTest | Should -HaveParameter PowerPlan -Type System.String + $CommandUnderTest | Should -HaveParameter PowerPlan } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaPrivilege.Tests.ps1 b/tests/Set-DbaPrivilege.Tests.ps1 index e908b876b2..ffca2cbc8f 100644 --- a/tests/Set-DbaPrivilege.Tests.ps1 +++ b/tests/Set-DbaPrivilege.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Set-DbaPrivilege" { $CommandUnderTest = Get-Command Set-DbaPrivilege } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] + $CommandUnderTest | Should -HaveParameter Type } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have User as a parameter" { - $CommandUnderTest | Should -HaveParameter User -Type System.String + $CommandUnderTest | Should -HaveParameter User } } } diff --git a/tests/Set-DbaResourceGovernor.Tests.ps1 b/tests/Set-DbaResourceGovernor.Tests.ps1 index 09820e8cd1..5cc546373d 100644 --- a/tests/Set-DbaResourceGovernor.Tests.ps1 +++ b/tests/Set-DbaResourceGovernor.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Set-DbaResourceGovernor" { $CommandUnderTest = Get-Command Set-DbaResourceGovernor } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Enabled as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Enabled -Type switch + $CommandUnderTest | Should -HaveParameter Enabled } It "Should have Disabled as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Disabled -Type switch + $CommandUnderTest | Should -HaveParameter Disabled } It "Should have ClassifierFunction as a parameter" { - $CommandUnderTest | Should -HaveParameter ClassifierFunction -Type System.String + $CommandUnderTest | Should -HaveParameter ClassifierFunction } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -41,27 +41,27 @@ Describe "Set-DbaResourceGovernor" { RETURN DB_NAME(); END;" Invoke-DbaQuery -SqlInstance $global:instance2 -Query $createUDFQuery -Database "master" - Set-DbaResourceGovernor -SqlInstance $global:instance2 -Disabled -Confirm:$false + Set-DbaResourceGovernor -SqlInstance $global:instance2 -Disabled } It "enables resource governor" { - $results = Set-DbaResourceGovernor -SqlInstance $global:instance2 -Enabled -Confirm:$false + $results = Set-DbaResourceGovernor -SqlInstance $global:instance2 -Enabled $results.Enabled | Should -Be $true } It "disables resource governor" { - $results = Set-DbaResourceGovernor -SqlInstance $global:instance2 -Disabled -Confirm:$false + $results = Set-DbaResourceGovernor -SqlInstance $global:instance2 -Disabled $results.Enabled | Should -Be $false } It "modifies resource governor classifier function" { $qualifiedClassifierFunction = "[dbo].[$classifierFunction]" - $results = Set-DbaResourceGovernor -SqlInstance $global:instance2 -ClassifierFunction $classifierFunction -Confirm:$false + $results = Set-DbaResourceGovernor -SqlInstance $global:instance2 -ClassifierFunction $classifierFunction $results.ClassifierFunction | Should -Be $qualifiedClassifierFunction } It "removes resource governor classifier function" { - $results = Set-DbaResourceGovernor -SqlInstance $global:instance2 -ClassifierFunction 'NULL' -Confirm:$false + $results = Set-DbaResourceGovernor -SqlInstance $global:instance2 -ClassifierFunction 'NULL' $results.ClassifierFunction | Should -Be '' } diff --git a/tests/Set-DbaRgResourcePool.Tests.ps1 b/tests/Set-DbaRgResourcePool.Tests.ps1 index 4843ff8790..225644133c 100644 --- a/tests/Set-DbaRgResourcePool.Tests.ps1 +++ b/tests/Set-DbaRgResourcePool.Tests.ps1 @@ -5,49 +5,49 @@ Describe "Set-DbaRgResourcePool" { $CommandUnderTest = Get-Command Set-DbaRgResourcePool } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have ResourcePool parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePool -Type String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ResourcePool } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type } It "Should have MinimumCpuPercentage parameter" { - $CommandUnderTest | Should -HaveParameter MinimumCpuPercentage -Type Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MinimumCpuPercentage } It "Should have MaximumCpuPercentage parameter" { - $CommandUnderTest | Should -HaveParameter MaximumCpuPercentage -Type Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaximumCpuPercentage } It "Should have CapCpuPercentage parameter" { - $CommandUnderTest | Should -HaveParameter CapCpuPercentage -Type Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CapCpuPercentage } It "Should have MinimumMemoryPercentage parameter" { - $CommandUnderTest | Should -HaveParameter MinimumMemoryPercentage -Type Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MinimumMemoryPercentage } It "Should have MaximumMemoryPercentage parameter" { - $CommandUnderTest | Should -HaveParameter MaximumMemoryPercentage -Type Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaximumMemoryPercentage } It "Should have MinimumIOPSPerVolume parameter" { - $CommandUnderTest | Should -HaveParameter MinimumIOPSPerVolume -Type Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MinimumIOPSPerVolume } It "Should have MaximumIOPSPerVolume parameter" { - $CommandUnderTest | Should -HaveParameter MaximumIOPSPerVolume -Type Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaximumIOPSPerVolume } It "Should have MaximumProcesses parameter" { - $CommandUnderTest | Should -HaveParameter MaximumProcesses -Type Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaximumProcesses } It "Should have SkipReconfigure parameter" { - $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SkipReconfigure } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaRgWorkloadGroup.Tests.ps1 b/tests/Set-DbaRgWorkloadGroup.Tests.ps1 index a99adc7727..21cd8be291 100644 --- a/tests/Set-DbaRgWorkloadGroup.Tests.ps1 +++ b/tests/Set-DbaRgWorkloadGroup.Tests.ps1 @@ -10,46 +10,46 @@ Describe "Set-DbaRgWorkloadGroup" { $CommandUnderTest = Get-Command Set-DbaRgWorkloadGroup } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have WorkloadGroup parameter" { - $CommandUnderTest | Should -HaveParameter WorkloadGroup -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WorkloadGroup } It "Should have ResourcePool parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePool -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ResourcePool } It "Should have ResourcePoolType parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePoolType -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ResourcePoolType } It "Should have Importance parameter" { - $CommandUnderTest | Should -HaveParameter Importance -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Importance } It "Should have RequestMaximumMemoryGrantPercentage parameter" { - $CommandUnderTest | Should -HaveParameter RequestMaximumMemoryGrantPercentage -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter RequestMaximumMemoryGrantPercentage } It "Should have RequestMaximumCpuTimeInSeconds parameter" { - $CommandUnderTest | Should -HaveParameter RequestMaximumCpuTimeInSeconds -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter RequestMaximumCpuTimeInSeconds } It "Should have RequestMemoryGrantTimeoutInSeconds parameter" { - $CommandUnderTest | Should -HaveParameter RequestMemoryGrantTimeoutInSeconds -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter RequestMemoryGrantTimeoutInSeconds } It "Should have MaximumDegreeOfParallelism parameter" { - $CommandUnderTest | Should -HaveParameter MaximumDegreeOfParallelism -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaximumDegreeOfParallelism } It "Should have GroupMaximumRequests parameter" { - $CommandUnderTest | Should -HaveParameter GroupMaximumRequests -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter GroupMaximumRequests } It "Should have SkipReconfigure parameter" { - $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SkipReconfigure } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.WorkloadGroup[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaSpConfigure.Tests.ps1 b/tests/Set-DbaSpConfigure.Tests.ps1 index cb826d31c8..ce567f4313 100644 --- a/tests/Set-DbaSpConfigure.Tests.ps1 +++ b/tests/Set-DbaSpConfigure.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Set-DbaSpConfigure" { $CommandUnderTest = Get-Command Set-DbaSpConfigure } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Value as a parameter" { - $CommandUnderTest | Should -HaveParameter Value -Type System.Int32 + $CommandUnderTest | Should -HaveParameter Value } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String[] + $CommandUnderTest | Should -HaveParameter Name } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaSpn.Tests.ps1 b/tests/Set-DbaSpn.Tests.ps1 index 4e9304bbe5..f39ba456ad 100644 --- a/tests/Set-DbaSpn.Tests.ps1 +++ b/tests/Set-DbaSpn.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Set-DbaSpn" { $CommandUnderTest = Get-Command Set-DbaSpn } It "Should have SPN as a parameter" { - $CommandUnderTest | Should -HaveParameter SPN -Type System.String + $CommandUnderTest | Should -HaveParameter SPN } It "Should have ServiceAccount as a parameter" { - $CommandUnderTest | Should -HaveParameter ServiceAccount -Type System.String + $CommandUnderTest | Should -HaveParameter ServiceAccount } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have NoDelegation as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoDelegation -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoDelegation } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaStartupParameter.Tests.ps1 b/tests/Set-DbaStartupParameter.Tests.ps1 index 441d422301..32215b3254 100644 --- a/tests/Set-DbaStartupParameter.Tests.ps1 +++ b/tests/Set-DbaStartupParameter.Tests.ps1 @@ -16,73 +16,73 @@ Describe "Set-DbaStartupParameter" { $CommandUnderTest = Get-Command Set-DbaStartupParameter } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have MasterData as a parameter" { - $CommandUnderTest | Should -HaveParameter MasterData -Type System.String + $CommandUnderTest | Should -HaveParameter MasterData } It "Should have MasterLog as a parameter" { - $CommandUnderTest | Should -HaveParameter MasterLog -Type System.String + $CommandUnderTest | Should -HaveParameter MasterLog } It "Should have ErrorLog as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorLog -Type System.String + $CommandUnderTest | Should -HaveParameter ErrorLog } It "Should have TraceFlag as a parameter" { - $CommandUnderTest | Should -HaveParameter TraceFlag -Type System.String[] + $CommandUnderTest | Should -HaveParameter TraceFlag } It "Should have CommandPromptStart as a switch parameter" { - $CommandUnderTest | Should -HaveParameter CommandPromptStart -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter CommandPromptStart } It "Should have MinimalStart as a switch parameter" { - $CommandUnderTest | Should -HaveParameter MinimalStart -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter MinimalStart } It "Should have MemoryToReserve as a parameter" { - $CommandUnderTest | Should -HaveParameter MemoryToReserve -Type System.Int32 + $CommandUnderTest | Should -HaveParameter MemoryToReserve } It "Should have SingleUser as a switch parameter" { - $CommandUnderTest | Should -HaveParameter SingleUser -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter SingleUser } It "Should have SingleUserDetails as a parameter" { - $CommandUnderTest | Should -HaveParameter SingleUserDetails -Type System.String + $CommandUnderTest | Should -HaveParameter SingleUserDetails } It "Should have NoLoggingToWinEvents as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoLoggingToWinEvents -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoLoggingToWinEvents } It "Should have StartAsNamedInstance as a switch parameter" { - $CommandUnderTest | Should -HaveParameter StartAsNamedInstance -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter StartAsNamedInstance } It "Should have DisableMonitoring as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DisableMonitoring -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DisableMonitoring } It "Should have IncreasedExtents as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncreasedExtents -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter IncreasedExtents } It "Should have TraceFlagOverride as a switch parameter" { - $CommandUnderTest | Should -HaveParameter TraceFlagOverride -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter TraceFlagOverride } It "Should have StartupConfig as a parameter" { - $CommandUnderTest | Should -HaveParameter StartupConfig -Type Object + $CommandUnderTest | Should -HaveParameter StartupConfig } It "Should have Offline as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Offline -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Offline } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } Context "Validate command functionality" -Skip:$SkipLocalTest { It "Ensure the startup params are not duplicated when more than one server is modified in the same invocation" { - $result = Set-DbaStartupParameter -SqlInstance $defaultInstance, $namedInstance -TraceFlag 3226 -Confirm:$false + $result = Set-DbaStartupParameter -SqlInstance $defaultInstance, $namedInstance -TraceFlag 3226 $resultDefaultInstance = Get-DbaStartupParameter -SqlInstance $defaultInstance $resultDefaultInstance.TraceFlags.Count | Should -Be 1 @@ -100,7 +100,7 @@ Describe "Set-DbaStartupParameter" { } It "Ensure the correct instance name is returned" { - $result = Set-DbaStartupParameter -SqlInstance $namedInstance -TraceFlag 3226 -Confirm:$false + $result = Set-DbaStartupParameter -SqlInstance $namedInstance -TraceFlag 3226 $result.SqlInstance | Should -Not -BeNullOrEmpty $result.TraceFlags.Count | Should -Be 1 diff --git a/tests/Set-DbaTcpPort.Tests.ps1 b/tests/Set-DbaTcpPort.Tests.ps1 index 7e566cce5a..b81155d243 100644 --- a/tests/Set-DbaTcpPort.Tests.ps1 +++ b/tests/Set-DbaTcpPort.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Set-DbaTcpPort" { $CommandUnderTest = Get-Command Set-DbaTcpPort } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Port as a parameter" { - $CommandUnderTest | Should -HaveParameter Port -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter Port } It "Should have IpAddress as a parameter" { - $CommandUnderTest | Should -HaveParameter IpAddress -Type System.Net.IPAddress[] + $CommandUnderTest | Should -HaveParameter IpAddress } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbaTempDbConfig.Tests.ps1 b/tests/Set-DbaTempDbConfig.Tests.ps1 index 727978bca9..473e6e678d 100644 --- a/tests/Set-DbaTempDbConfig.Tests.ps1 +++ b/tests/Set-DbaTempDbConfig.Tests.ps1 @@ -31,43 +31,43 @@ Describe "Set-DbaTempDbConfig" { $CommandUnderTest = Get-Command Set-DbaTempDbConfig } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have DataFileCount as a parameter" { - $CommandUnderTest | Should -HaveParameter DataFileCount -Type System.Int32 + $CommandUnderTest | Should -HaveParameter DataFileCount } It "Should have DataFileSize as a parameter" { - $CommandUnderTest | Should -HaveParameter DataFileSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter DataFileSize } It "Should have LogFileSize as a parameter" { - $CommandUnderTest | Should -HaveParameter LogFileSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter LogFileSize } It "Should have DataFileGrowth as a parameter" { - $CommandUnderTest | Should -HaveParameter DataFileGrowth -Type System.Int32 + $CommandUnderTest | Should -HaveParameter DataFileGrowth } It "Should have LogFileGrowth as a parameter" { - $CommandUnderTest | Should -HaveParameter LogFileGrowth -Type System.Int32 + $CommandUnderTest | Should -HaveParameter LogFileGrowth } It "Should have DataPath as a parameter" { - $CommandUnderTest | Should -HaveParameter DataPath -Type System.String[] + $CommandUnderTest | Should -HaveParameter DataPath } It "Should have LogPath as a parameter" { - $CommandUnderTest | Should -HaveParameter LogPath -Type System.String + $CommandUnderTest | Should -HaveParameter LogPath } It "Should have OutFile as a parameter" { - $CommandUnderTest | Should -HaveParameter OutFile -Type System.String + $CommandUnderTest | Should -HaveParameter OutFile } It "Should have OutputScriptOnly as a parameter" { - $CommandUnderTest | Should -HaveParameter OutputScriptOnly -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter OutputScriptOnly } It "Should have DisableGrowth as a parameter" { - $CommandUnderTest | Should -HaveParameter DisableGrowth -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DisableGrowth } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Set-DbatoolsConfig.Tests.ps1 b/tests/Set-DbatoolsConfig.Tests.ps1 index c61544be76..7b5d8f88c9 100644 --- a/tests/Set-DbatoolsConfig.Tests.ps1 +++ b/tests/Set-DbatoolsConfig.Tests.ps1 @@ -5,62 +5,62 @@ Describe "Set-DbatoolsConfig" { BeforeAll { $CommandUnderTest = Get-Command Set-DbatoolsConfig } - It "Should have FullName as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter FullName -Type System.String -Mandatory:$false + It "Should have FullName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter FullName } - It "Should have Module as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Module -Type System.String -Mandatory:$false + It "Should have Module as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Module } - It "Should have Name as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String -Mandatory:$false + It "Should have Name as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Name } - It "Should have Value as a non-mandatory System.Object parameter" { - $CommandUnderTest | Should -HaveParameter Value -Type System.Object -Mandatory:$false + It "Should have Value as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Value } - It "Should have PersistedValue as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter PersistedValue -Type System.String -Mandatory:$false + It "Should have PersistedValue as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter PersistedValue } - It "Should have PersistedType as a non-mandatory Dataplat.Dbatools.Configuration.ConfigurationValueType parameter" { - $CommandUnderTest | Should -HaveParameter PersistedType -Type Dataplat.Dbatools.Configuration.ConfigurationValueType -Mandatory:$false + It "Should have PersistedType as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter PersistedType } - It "Should have Description as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Description -Type System.String -Mandatory:$false + It "Should have Description as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Description } - It "Should have Validation as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Validation -Type System.String -Mandatory:$false + It "Should have Validation as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Validation } - It "Should have Handler as a non-mandatory System.Management.Automation.ScriptBlock parameter" { - $CommandUnderTest | Should -HaveParameter Handler -Type System.Management.Automation.ScriptBlock -Mandatory:$false + It "Should have Handler as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Handler } - It "Should have Hidden as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter Hidden -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have Hidden as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Hidden } - It "Should have Default as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter Default -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have Default as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Default } - It "Should have Initialize as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter Initialize -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have Initialize as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Initialize } - It "Should have SimpleExport as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter SimpleExport -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have SimpleExport as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SimpleExport } - It "Should have ModuleExport as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter ModuleExport -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have ModuleExport as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ModuleExport } - It "Should have DisableValidation as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter DisableValidation -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have DisableValidation as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter DisableValidation } - It "Should have DisableHandler as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter DisableHandler -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have DisableHandler as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter DisableHandler } - It "Should have PassThru as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter PassThru -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have PassThru as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter PassThru } - It "Should have Register as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter Register -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have Register as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Register } - It "Should have EnableException as a non-mandatory System.Management.Automation.Switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + It "Should have EnableException as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Set-DbatoolsInsecureConnection.Tests.ps1 b/tests/Set-DbatoolsInsecureConnection.Tests.ps1 index eae6eca44c..294413855e 100644 --- a/tests/Set-DbatoolsInsecureConnection.Tests.ps1 +++ b/tests/Set-DbatoolsInsecureConnection.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Set-DbatoolsInsecureConnection" { $CommandUnderTest = Get-Command Set-DbatoolsInsecureConnection } It "Should have SessionOnly as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter SessionOnly -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SessionOnly } It "Should have Scope as a non-mandatory ConfigScope parameter" { - $CommandUnderTest | Should -HaveParameter Scope -Type Dataplat.Dbatools.Configuration.ConfigScope -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Scope } It "Should have Register as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Register -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Register } } diff --git a/tests/Set-DbatoolsPath.Tests.ps1 b/tests/Set-DbatoolsPath.Tests.ps1 index 86d30596c6..c1815206c8 100644 --- a/tests/Set-DbatoolsPath.Tests.ps1 +++ b/tests/Set-DbatoolsPath.Tests.ps1 @@ -11,17 +11,17 @@ Describe "Set-DbatoolsPath" { BeforeAll { $CommandUnderTest = Get-Command Set-DbatoolsPath } - It "Should have Name as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String -Mandatory:$false + It "Should have Name as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Name } - It "Should have Path as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } It "Should have Register as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Register -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Register } It "Should have Scope as a non-mandatory ConfigScope parameter" { - $CommandUnderTest | Should -HaveParameter Scope -Type Dataplat.Dbatools.Configuration.ConfigScope -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Scope } } } diff --git a/tests/Show-DbaDbList.Tests.ps1 b/tests/Show-DbaDbList.Tests.ps1 index ee33e6dca1..3de126ad45 100644 --- a/tests/Show-DbaDbList.Tests.ps1 +++ b/tests/Show-DbaDbList.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Show-DbaDbList" { $CommandUnderTest = Get-Command Show-DbaDbList } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Title as a parameter" { - $CommandUnderTest | Should -HaveParameter Title -Type System.String + $CommandUnderTest | Should -HaveParameter Title } It "Should have Header as a parameter" { - $CommandUnderTest | Should -HaveParameter Header -Type System.String + $CommandUnderTest | Should -HaveParameter Header } It "Should have DefaultDb as a parameter" { - $CommandUnderTest | Should -HaveParameter DefaultDb -Type System.String + $CommandUnderTest | Should -HaveParameter DefaultDb } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Show-DbaInstanceFileSystem.Tests.ps1 b/tests/Show-DbaInstanceFileSystem.Tests.ps1 index 31988d425f..a7314ff4a5 100644 --- a/tests/Show-DbaInstanceFileSystem.Tests.ps1 +++ b/tests/Show-DbaInstanceFileSystem.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Show-DbaInstanceFileSystem" { $CommandUnderTest = Get-Command Show-DbaInstanceFileSystem } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Start-DbaAgentJob.Tests.ps1 b/tests/Start-DbaAgentJob.Tests.ps1 index 7b39d093f2..bf4751d4cd 100644 --- a/tests/Start-DbaAgentJob.Tests.ps1 +++ b/tests/Start-DbaAgentJob.Tests.ps1 @@ -6,40 +6,40 @@ Describe "Start-DbaAgentJob" { $CommandUnderTest = Get-Command Start-DbaAgentJob } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Job parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.String[] + $CommandUnderTest | Should -HaveParameter Job } It "Should have StepName parameter" { - $CommandUnderTest | Should -HaveParameter StepName -Type System.String + $CommandUnderTest | Should -HaveParameter StepName } It "Should have ExcludeJob parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeJob -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeJob } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Agent.Job[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have AllJobs parameter" { - $CommandUnderTest | Should -HaveParameter AllJobs -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AllJobs } It "Should have Wait parameter" { - $CommandUnderTest | Should -HaveParameter Wait -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Wait } It "Should have Parallel parameter" { - $CommandUnderTest | Should -HaveParameter Parallel -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Parallel } It "Should have WaitPeriod parameter" { - $CommandUnderTest | Should -HaveParameter WaitPeriod -Type System.Int32 + $CommandUnderTest | Should -HaveParameter WaitPeriod } It "Should have SleepPeriod parameter" { - $CommandUnderTest | Should -HaveParameter SleepPeriod -Type System.Int32 + $CommandUnderTest | Should -HaveParameter SleepPeriod } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Start-DbaDbEncryption.Tests.ps1 b/tests/Start-DbaDbEncryption.Tests.ps1 index 48b57fda1c..7114af2950 100644 --- a/tests/Start-DbaDbEncryption.Tests.ps1 +++ b/tests/Start-DbaDbEncryption.Tests.ps1 @@ -22,52 +22,52 @@ Describe "Start-DbaDbEncryption" { $CommandUnderTest = Get-Command Start-DbaDbEncryption } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type Microsoft.SqlServer.Management.Smo.Credential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EncryptorName as a parameter" { - $CommandUnderTest | Should -HaveParameter EncryptorName -Type System.String + $CommandUnderTest | Should -HaveParameter EncryptorName } It "Should have EncryptorType as a parameter" { - $CommandUnderTest | Should -HaveParameter EncryptorType -Type System.String + $CommandUnderTest | Should -HaveParameter EncryptorType } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have BackupPath as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupPath -Type System.String + $CommandUnderTest | Should -HaveParameter BackupPath } It "Should have MasterKeySecurePassword as a parameter" { - $CommandUnderTest | Should -HaveParameter MasterKeySecurePassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter MasterKeySecurePassword } It "Should have CertificateSubject as a parameter" { - $CommandUnderTest | Should -HaveParameter CertificateSubject -Type System.String + $CommandUnderTest | Should -HaveParameter CertificateSubject } It "Should have CertificateStartDate as a parameter" { - $CommandUnderTest | Should -HaveParameter CertificateStartDate -Type System.DateTime + $CommandUnderTest | Should -HaveParameter CertificateStartDate } It "Should have CertificateExpirationDate as a parameter" { - $CommandUnderTest | Should -HaveParameter CertificateExpirationDate -Type System.DateTime + $CommandUnderTest | Should -HaveParameter CertificateExpirationDate } It "Should have CertificateActiveForServiceBrokerDialog as a parameter" { - $CommandUnderTest | Should -HaveParameter CertificateActiveForServiceBrokerDialog -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter CertificateActiveForServiceBrokerDialog } It "Should have BackupSecurePassword as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupSecurePassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter BackupSecurePassword } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have AllUserDatabases as a parameter" { - $CommandUnderTest | Should -HaveParameter AllUserDatabases -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AllUserDatabases } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Start-DbaEndpoint.Tests.ps1 b/tests/Start-DbaEndpoint.Tests.ps1 index acf5895f2d..aadb8eecac 100644 --- a/tests/Start-DbaEndpoint.Tests.ps1 +++ b/tests/Start-DbaEndpoint.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Start-DbaEndpoint" { $CommandUnderTest = Get-Command Start-DbaEndpoint } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Endpoint as a parameter" { - $CommandUnderTest | Should -HaveParameter Endpoint -Type System.String[] + $CommandUnderTest | Should -HaveParameter Endpoint } It "Should have AllEndpoints as a switch parameter" { - $CommandUnderTest | Should -HaveParameter AllEndpoints -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AllEndpoints } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Endpoint[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -34,15 +34,15 @@ Describe "Start-DbaEndpoint" { BeforeAll { $server = Connect-DbaInstance -SqlInstance $global:instance2 $endpoint = Get-DbaEndpoint -SqlInstance $server -Endpoint 'TSQL Default TCP' - $endpoint | Stop-DbaEndpoint -Confirm:$false + $endpoint | Stop-DbaEndpoint } AfterAll { - $endpoint | Start-DbaEndpoint -Confirm:$false + $endpoint | Start-DbaEndpoint } It "starts the endpoint" { - $results = $endpoint | Start-DbaEndpoint -Confirm:$false + $results = $endpoint | Start-DbaEndpoint $results.EndpointState | Should -Be 'Started' } } diff --git a/tests/Start-DbaMigration.Tests.ps1 b/tests/Start-DbaMigration.Tests.ps1 index 042125d20c..73ed61bf05 100644 --- a/tests/Start-DbaMigration.Tests.ps1 +++ b/tests/Start-DbaMigration.Tests.ps1 @@ -30,79 +30,79 @@ Describe "Start-DbaMigration" { $CommandUnderTest = Get-Command Start-DbaMigration } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DetachAttach as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DetachAttach -Type switch + $CommandUnderTest | Should -HaveParameter DetachAttach } It "Should have Reattach as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Reattach -Type switch + $CommandUnderTest | Should -HaveParameter Reattach } It "Should have BackupRestore as a switch parameter" { - $CommandUnderTest | Should -HaveParameter BackupRestore -Type switch + $CommandUnderTest | Should -HaveParameter BackupRestore } It "Should have SharedPath as a string parameter" { - $CommandUnderTest | Should -HaveParameter SharedPath -Type System.String + $CommandUnderTest | Should -HaveParameter SharedPath } It "Should have WithReplace as a switch parameter" { - $CommandUnderTest | Should -HaveParameter WithReplace -Type switch + $CommandUnderTest | Should -HaveParameter WithReplace } It "Should have NoRecovery as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoRecovery -Type switch + $CommandUnderTest | Should -HaveParameter NoRecovery } It "Should have SetSourceReadOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter SetSourceReadOnly -Type switch + $CommandUnderTest | Should -HaveParameter SetSourceReadOnly } It "Should have ReuseSourceFolderStructure as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ReuseSourceFolderStructure -Type switch + $CommandUnderTest | Should -HaveParameter ReuseSourceFolderStructure } It "Should have IncludeSupportDbs as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSupportDbs -Type switch + $CommandUnderTest | Should -HaveParameter IncludeSupportDbs } It "Should have SourceSqlCredential as a PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have DestinationSqlCredential as a PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Exclude as a string array parameter" { - $CommandUnderTest | Should -HaveParameter Exclude -Type System.String[] + $CommandUnderTest | Should -HaveParameter Exclude } It "Should have DisableJobsOnDestination as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DisableJobsOnDestination -Type switch + $CommandUnderTest | Should -HaveParameter DisableJobsOnDestination } It "Should have DisableJobsOnSource as a switch parameter" { - $CommandUnderTest | Should -HaveParameter DisableJobsOnSource -Type switch + $CommandUnderTest | Should -HaveParameter DisableJobsOnSource } It "Should have ExcludeSaRename as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSaRename -Type switch + $CommandUnderTest | Should -HaveParameter ExcludeSaRename } It "Should have UseLastBackup as a switch parameter" { - $CommandUnderTest | Should -HaveParameter UseLastBackup -Type switch + $CommandUnderTest | Should -HaveParameter UseLastBackup } It "Should have KeepCDC as a switch parameter" { - $CommandUnderTest | Should -HaveParameter KeepCDC -Type switch + $CommandUnderTest | Should -HaveParameter KeepCDC } It "Should have KeepReplication as a switch parameter" { - $CommandUnderTest | Should -HaveParameter KeepReplication -Type switch + $CommandUnderTest | Should -HaveParameter KeepReplication } It "Should have Continue as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Continue -Type switch + $CommandUnderTest | Should -HaveParameter Continue } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type switch + $CommandUnderTest | Should -HaveParameter Force } It "Should have AzureCredential as a string parameter" { - $CommandUnderTest | Should -HaveParameter AzureCredential -Type System.String + $CommandUnderTest | Should -HaveParameter AzureCredential } It "Should have MasterKeyPassword as a SecureString parameter" { - $CommandUnderTest | Should -HaveParameter MasterKeyPassword -Type System.Security.SecureString + $CommandUnderTest | Should -HaveParameter MasterKeyPassword } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Start-DbaPfDataCollectorSet.Tests.ps1 b/tests/Start-DbaPfDataCollectorSet.Tests.ps1 index d6a3e90639..5f863a323c 100644 --- a/tests/Start-DbaPfDataCollectorSet.Tests.ps1 +++ b/tests/Start-DbaPfDataCollectorSet.Tests.ps1 @@ -5,23 +5,23 @@ Describe "Start-DbaPfDataCollectorSet" { BeforeAll { $CommandUnderTest = Get-Command Start-DbaPfDataCollectorSet } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type Microsoft.SqlServer.Management.Smo.Credential[]" { - $CommandUnderTest | Should -HaveParameter Credential -Type Microsoft.SqlServer.Management.Smo.Credential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } - It "Should have CollectorSet as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter CollectorSet -Type System.String[] -Mandatory:$false + It "Should have CollectorSet as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter CollectorSet } - It "Should have InputObject as a non-mandatory parameter of type System.Object[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + It "Should have InputObject as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have NoWait as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter NoWait -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoWait } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Start-DbaService.Tests.ps1 b/tests/Start-DbaService.Tests.ps1 index 238ed5a391..a104999687 100644 --- a/tests/Start-DbaService.Tests.ps1 +++ b/tests/Start-DbaService.Tests.ps1 @@ -10,28 +10,28 @@ Describe "Start-DbaService" { $CommandUnderTest = Get-Command Start-DbaService } It "Should have ComputerName parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have InstanceName parameter" { - $CommandUnderTest | Should -HaveParameter InstanceName -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InstanceName } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Timeout parameter" { - $CommandUnderTest | Should -HaveParameter Timeout -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Timeout } It "Should have Credential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Start-DbaTrace.Tests.ps1 b/tests/Start-DbaTrace.Tests.ps1 index 49cf2ff0ba..1ade60ef63 100644 --- a/tests/Start-DbaTrace.Tests.ps1 +++ b/tests/Start-DbaTrace.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Start-DbaTrace" { $CommandUnderTest = Get-Command Start-DbaTrace } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Id as a parameter" { - $CommandUnderTest | Should -HaveParameter Id -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter Id } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Start-DbaXESession.Tests.ps1 b/tests/Start-DbaXESession.Tests.ps1 index 5db4edadae..e54ecd4c53 100644 --- a/tests/Start-DbaXESession.Tests.ps1 +++ b/tests/Start-DbaXESession.Tests.ps1 @@ -34,7 +34,7 @@ Describe "Start-DbaXESession" { # Drop created objects $conn.ExecuteNonQuery("IF EXISTS(SELECT * FROM sys.server_event_sessions WHERE name = 'dbatoolsci_session_invalid') DROP EVENT SESSION [dbatoolsci_session_invalid] ON SERVER;") $conn.ExecuteNonQuery("IF EXISTS(SELECT * FROM sys.server_event_sessions WHERE name = 'dbatoolsci_session_valid') DROP EVENT SESSION [dbatoolsci_session_valid] ON SERVER;") - Get-DbaAgentSchedule -SqlInstance $global:instance2 -Schedule "XE Session START - dbatoolsci_session_valid", "XE Session STOP - dbatoolsci_session_valid" | Remove-DbaAgentSchedule -Force -Confirm:$false + Get-DbaAgentSchedule -SqlInstance $global:instance2 -Schedule "XE Session START - dbatoolsci_session_valid", "XE Session STOP - dbatoolsci_session_valid" | Remove-DbaAgentSchedule -Force } Context "Validate parameters" { @@ -42,28 +42,28 @@ Describe "Start-DbaXESession" { $CommandUnderTest = Get-Command Start-DbaXESession } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Session as a parameter" { - $CommandUnderTest | Should -HaveParameter Session -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Session } It "Should have StartAt as a parameter" { - $CommandUnderTest | Should -HaveParameter StartAt -Type System.DateTime + $CommandUnderTest | Should -HaveParameter StartAt } It "Should have StopAt as a parameter" { - $CommandUnderTest | Should -HaveParameter StopAt -Type System.DateTime + $CommandUnderTest | Should -HaveParameter StopAt } It "Should have AllSessions as a parameter" { - $CommandUnderTest | Should -HaveParameter AllSessions -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AllSessions } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.XEvent.Session[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Start-DbaXESmartTarget.Tests.ps1 b/tests/Start-DbaXESmartTarget.Tests.ps1 index 4e9c06fd82..e2a31aeafd 100644 --- a/tests/Start-DbaXESmartTarget.Tests.ps1 +++ b/tests/Start-DbaXESmartTarget.Tests.ps1 @@ -6,31 +6,31 @@ Describe "Start-DbaXESmartTarget" { $CommandUnderTest = Get-Command Start-DbaXESmartTarget } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have Session parameter" { - $CommandUnderTest | Should -HaveParameter Session -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Session } It "Should have FailOnProcessingError parameter" { - $CommandUnderTest | Should -HaveParameter FailOnProcessingError -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FailOnProcessingError } It "Should have Responder parameter" { - $CommandUnderTest | Should -HaveParameter Responder -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Responder } It "Should have Template parameter" { - $CommandUnderTest | Should -HaveParameter Template -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Template } It "Should have NotAsJob parameter" { - $CommandUnderTest | Should -HaveParameter NotAsJob -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NotAsJob } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Stop-DbaAgentJob.Tests.ps1 b/tests/Stop-DbaAgentJob.Tests.ps1 index 2cfe8a774d..6a24ed1b92 100644 --- a/tests/Stop-DbaAgentJob.Tests.ps1 +++ b/tests/Stop-DbaAgentJob.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Stop-DbaAgentJob" { $CommandUnderTest = Get-Command Stop-DbaAgentJob } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Job as a parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.String[] + $CommandUnderTest | Should -HaveParameter Job } It "Should have ExcludeJob as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeJob -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeJob } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Agent.Job[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Wait as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Wait -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Wait } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Stop-DbaDbEncryption.Tests.ps1 b/tests/Stop-DbaDbEncryption.Tests.ps1 index 0bca878c17..e6cac780bc 100644 --- a/tests/Stop-DbaDbEncryption.Tests.ps1 +++ b/tests/Stop-DbaDbEncryption.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Stop-DbaDbEncryption" { $CommandUnderTest = Get-Command Stop-DbaDbEncryption } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Stop-DbaEndpoint.Tests.ps1 b/tests/Stop-DbaEndpoint.Tests.ps1 index 90046b9b8e..d48b1f5c67 100644 --- a/tests/Stop-DbaEndpoint.Tests.ps1 +++ b/tests/Stop-DbaEndpoint.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Stop-DbaEndpoint" { $CommandUnderTest = Get-Command Stop-DbaEndpoint } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Endpoint as a parameter" { - $CommandUnderTest | Should -HaveParameter Endpoint -Type System.String[] + $CommandUnderTest | Should -HaveParameter Endpoint } It "Should have AllEndpoints as a switch parameter" { - $CommandUnderTest | Should -HaveParameter AllEndpoints -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AllEndpoints } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Endpoint[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -42,7 +42,7 @@ Describe "Stop-DbaEndpoint" { } It "stops the endpoint" { - $results = $endpoint | Stop-DbaEndpoint -Confirm:$false + $results = $endpoint | Stop-DbaEndpoint $results.EndpointState | Should -Be 'Stopped' } } diff --git a/tests/Stop-DbaExternalProcess.Tests.ps1 b/tests/Stop-DbaExternalProcess.Tests.ps1 index 6484eb746d..71124a537b 100644 --- a/tests/Stop-DbaExternalProcess.Tests.ps1 +++ b/tests/Stop-DbaExternalProcess.Tests.ps1 @@ -10,16 +10,16 @@ Describe "Stop-DbaExternalProcess" { $CommandUnderTest = Get-Command Stop-DbaExternalProcess } It "Should have ComputerName as a non-mandatory DbaInstanceParameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a non-mandatory PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have ProcessId as a non-mandatory Int32" { - $CommandUnderTest | Should -HaveParameter ProcessId -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ProcessId } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Stop-DbaPfDataCollectorSet.Tests.ps1 b/tests/Stop-DbaPfDataCollectorSet.Tests.ps1 index 1e7efc90fe..96429c875a 100644 --- a/tests/Stop-DbaPfDataCollectorSet.Tests.ps1 +++ b/tests/Stop-DbaPfDataCollectorSet.Tests.ps1 @@ -5,22 +5,22 @@ Describe "Stop-DbaPfDataCollectorSet" { $CommandUnderTest = Get-Command Stop-DbaPfDataCollectorSet } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have CollectorSet as a parameter" { - $CommandUnderTest | Should -HaveParameter CollectorSet -Type System.String[] + $CommandUnderTest | Should -HaveParameter CollectorSet } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have NoWait as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoWait -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoWait } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Stop-DbaProcess.Tests.ps1 b/tests/Stop-DbaProcess.Tests.ps1 index 2a826fee79..45531264e3 100644 --- a/tests/Stop-DbaProcess.Tests.ps1 +++ b/tests/Stop-DbaProcess.Tests.ps1 @@ -6,34 +6,34 @@ Describe "Stop-DbaProcess" { $CommandUnderTest = Get-Command Stop-DbaProcess } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Spid as a parameter" { - $CommandUnderTest | Should -HaveParameter Spid -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter Spid } It "Should have ExcludeSpid as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSpid -Type System.Int32[] + $CommandUnderTest | Should -HaveParameter ExcludeSpid } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String[] + $CommandUnderTest | Should -HaveParameter Login } It "Should have Hostname as a parameter" { - $CommandUnderTest | Should -HaveParameter Hostname -Type System.String[] + $CommandUnderTest | Should -HaveParameter Hostname } It "Should have Program as a parameter" { - $CommandUnderTest | Should -HaveParameter Program -Type System.String[] + $CommandUnderTest | Should -HaveParameter Program } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Stop-DbaService.Tests.ps1 b/tests/Stop-DbaService.Tests.ps1 index caeae5e892..f2cc0e3f7a 100644 --- a/tests/Stop-DbaService.Tests.ps1 +++ b/tests/Stop-DbaService.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Stop-DbaService" { $CommandUnderTest = Get-Command Stop-DbaService } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have InstanceName as a parameter" { - $CommandUnderTest | Should -HaveParameter InstanceName -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InstanceName } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Type } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Timeout as a parameter" { - $CommandUnderTest | Should -HaveParameter Timeout -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Timeout } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Stop-DbaTrace.Tests.ps1 b/tests/Stop-DbaTrace.Tests.ps1 index 2caa718a3e..93756a8420 100644 --- a/tests/Stop-DbaTrace.Tests.ps1 +++ b/tests/Stop-DbaTrace.Tests.ps1 @@ -11,19 +11,19 @@ Describe "Stop-DbaTrace Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Stop-DbaTrace } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Id as a parameter" { - $CommandUnderTest | Should -HaveParameter Id -Type System.Int32[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Id } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Stop-DbaXESession.Tests.ps1 b/tests/Stop-DbaXESession.Tests.ps1 index fc1f54b790..46e1bcb17e 100644 --- a/tests/Stop-DbaXESession.Tests.ps1 +++ b/tests/Stop-DbaXESession.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Stop-DbaXESession" { $CommandUnderTest = Get-Command Stop-DbaXESession } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Session parameter" { - $CommandUnderTest | Should -HaveParameter Session -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Session } It "Should have AllSessions parameter" { - $CommandUnderTest | Should -HaveParameter AllSessions -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AllSessions } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.XEvent.Session[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Stop-DbaXESmartTarget.Tests.ps1 b/tests/Stop-DbaXESmartTarget.Tests.ps1 index ba027acfe6..870e7bced7 100644 --- a/tests/Stop-DbaXESmartTarget.Tests.ps1 +++ b/tests/Stop-DbaXESmartTarget.Tests.ps1 @@ -6,10 +6,10 @@ Describe "Stop-DbaXESmartTarget" { $CommandUnderTest = Get-Command Stop-DbaXESmartTarget } It "Accepts InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Accepts EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Stop-Function.Tests.ps1 b/tests/Stop-Function.Tests.ps1 index d9a1a3da51..d6c7b002f8 100644 --- a/tests/Stop-Function.Tests.ps1 +++ b/tests/Stop-Function.Tests.ps1 @@ -11,46 +11,46 @@ Describe "Stop-Function" { $CommandUnderTest = Get-Command Stop-Function } It "Should have Message as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter Message -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Message } It "Should have EnableException as a non-mandatory System.Boolean parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Boolean -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have Category as a non-mandatory System.Management.Automation.ErrorCategory parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type System.Management.Automation.ErrorCategory -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Category } It "Should have ErrorRecord as a non-mandatory System.Management.Automation.ErrorRecord[] parameter" { - $CommandUnderTest | Should -HaveParameter ErrorRecord -Type System.Management.Automation.ErrorRecord[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ErrorRecord } It "Should have Tag as a non-mandatory System.String[] parameter" { - $CommandUnderTest | Should -HaveParameter Tag -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Tag } It "Should have FunctionName as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter FunctionName -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FunctionName } It "Should have File as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter File -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter File } It "Should have Line as a non-mandatory System.Int32 parameter" { - $CommandUnderTest | Should -HaveParameter Line -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Line } It "Should have Target as a non-mandatory System.Object parameter" { - $CommandUnderTest | Should -HaveParameter Target -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Target } It "Should have Exception as a non-mandatory System.Exception parameter" { - $CommandUnderTest | Should -HaveParameter Exception -Type System.Exception -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Exception } It "Should have OverrideExceptionMessage as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter OverrideExceptionMessage -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OverrideExceptionMessage } It "Should have Continue as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter Continue -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Continue } It "Should have SilentlyContinue as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter SilentlyContinue -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SilentlyContinue } It "Should have ContinueLabel as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter ContinueLabel -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ContinueLabel } } diff --git a/tests/Suspend-DbaAgDbDataMovement.Tests.ps1 b/tests/Suspend-DbaAgDbDataMovement.Tests.ps1 index aa1b0cbbee..0175c284b0 100644 --- a/tests/Suspend-DbaAgDbDataMovement.Tests.ps1 +++ b/tests/Suspend-DbaAgDbDataMovement.Tests.ps1 @@ -13,13 +13,13 @@ Describe "Suspend-DbaAgDbDataMovement" { $server.Query("create database $dbname") $null = Get-DbaDatabase -SqlInstance $global:instance3 -Database $dbname | Backup-DbaDatabase $null = Get-DbaDatabase -SqlInstance $global:instance3 -Database $dbname | Backup-DbaDatabase -Type Log - $ag = New-DbaAvailabilityGroup -Primary $global:instance3 -Name $agname -ClusterType None -FailoverMode Manual -Database $dbname -Confirm:$false -Certificate dbatoolsci_AGCert -UseLastBackup - $null = Get-DbaAgDatabase -SqlInstance $global:instance3 -AvailabilityGroup $agname | Resume-DbaAgDbDataMovement -Confirm:$false + $ag = New-DbaAvailabilityGroup -Primary $global:instance3 -Name $agname -ClusterType None -FailoverMode Manual -Database $dbname -Certificate dbatoolsci_AGCert -UseLastBackup + $null = Get-DbaAgDatabase -SqlInstance $global:instance3 -AvailabilityGroup $agname | Resume-DbaAgDbDataMovement } AfterAll { - $null = Remove-DbaAvailabilityGroup -SqlInstance $server -AvailabilityGroup $agname -Confirm:$false - $null = Remove-DbaDatabase -SqlInstance $server -Database $dbname -Confirm:$false + $null = Remove-DbaAvailabilityGroup -SqlInstance $server -AvailabilityGroup $agname + $null = Remove-DbaDatabase -SqlInstance $server -Database $dbname } Context "Validate parameters" { @@ -27,28 +27,28 @@ Describe "Suspend-DbaAgDbDataMovement" { $CommandUnderTest = Get-Command Suspend-DbaAgDbDataMovement } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityDatabase[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } Context "Suspends data movement" { It "returns suspended results" { - $results = Suspend-DbaAgDbDataMovement -SqlInstance $global:instance3 -Database $dbname -Confirm:$false + $results = Suspend-DbaAgDbDataMovement -SqlInstance $global:instance3 -Database $dbname $results.AvailabilityGroup | Should -Be $agname $results.Name | Should -Be $dbname $results.SynchronizationState | Should -Be 'NotSynchronizing' diff --git a/tests/Sync-DbaAvailabilityGroup.Tests.ps1 b/tests/Sync-DbaAvailabilityGroup.Tests.ps1 index 615342edee..5fb6e2c1b5 100644 --- a/tests/Sync-DbaAvailabilityGroup.Tests.ps1 +++ b/tests/Sync-DbaAvailabilityGroup.Tests.ps1 @@ -12,46 +12,46 @@ Describe "Sync-DbaAvailabilityGroup" { $CommandUnderTest = Get-Command Sync-DbaAvailabilityGroup } It "Should have Primary parameter" { - $CommandUnderTest | Should -HaveParameter Primary -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Primary } It "Should have PrimarySqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter PrimarySqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter PrimarySqlCredential } It "Should have Secondary parameter" { - $CommandUnderTest | Should -HaveParameter Secondary -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Secondary } It "Should have SecondarySqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SecondarySqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SecondarySqlCredential } It "Should have AvailabilityGroup parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have Exclude parameter" { - $CommandUnderTest | Should -HaveParameter Exclude -Type System.String[] + $CommandUnderTest | Should -HaveParameter Exclude } It "Should have Login parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String[] + $CommandUnderTest | Should -HaveParameter Login } It "Should have ExcludeLogin parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeLogin -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeLogin } It "Should have Job parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.String[] + $CommandUnderTest | Should -HaveParameter Job } It "Should have ExcludeJob parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeJob -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeJob } It "Should have DisableJobOnDestination parameter" { - $CommandUnderTest | Should -HaveParameter DisableJobOnDestination -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DisableJobOnDestination } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityGroup[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Sync-DbaLoginPermission.Tests.ps1 b/tests/Sync-DbaLoginPermission.Tests.ps1 index b35b60db8c..8d437d4bf9 100644 --- a/tests/Sync-DbaLoginPermission.Tests.ps1 +++ b/tests/Sync-DbaLoginPermission.Tests.ps1 @@ -35,25 +35,25 @@ CREATE LOGIN [$DBUserName] $CommandUnderTest = Get-Command Sync-DbaLoginPermission } It "Should have Source as a parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String[] + $CommandUnderTest | Should -HaveParameter Login } It "Should have ExcludeLogin as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeLogin -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeLogin } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaAgSpn.Tests.ps1 b/tests/Test-DbaAgSpn.Tests.ps1 index 0ca50c360e..b27497ef12 100644 --- a/tests/Test-DbaAgSpn.Tests.ps1 +++ b/tests/Test-DbaAgSpn.Tests.ps1 @@ -10,25 +10,25 @@ Describe "Test-DbaAgSpn" { $CommandUnderTest = Get-Command Test-DbaAgSpn } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have AvailabilityGroup parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have Listener parameter" { - $CommandUnderTest | Should -HaveParameter Listener -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Listener } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.AvailabilityGroup[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaAgentJobOwner.Tests.ps1 b/tests/Test-DbaAgentJobOwner.Tests.ps1 index 3ad1703b53..b2eb5e1146 100644 --- a/tests/Test-DbaAgentJobOwner.Tests.ps1 +++ b/tests/Test-DbaAgentJobOwner.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Test-DbaAgentJobOwner Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Test-DbaAgentJobOwner } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Job as a parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Job } It "Should have ExcludeJob as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeJob -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeJob } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Login } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Test-DbaAvailabilityGroup.Tests.ps1 b/tests/Test-DbaAvailabilityGroup.Tests.ps1 index 1baed01a89..bd37743f17 100644 --- a/tests/Test-DbaAvailabilityGroup.Tests.ps1 +++ b/tests/Test-DbaAvailabilityGroup.Tests.ps1 @@ -6,34 +6,34 @@ Describe "Test-DbaAvailabilityGroup" { $CommandUnderTest = Get-Command Test-DbaAvailabilityGroup } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type System.String + $CommandUnderTest | Should -HaveParameter AvailabilityGroup } It "Should have Secondary as a parameter" { - $CommandUnderTest | Should -HaveParameter Secondary -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter Secondary } It "Should have SecondarySqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SecondarySqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SecondarySqlCredential } It "Should have AddDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter AddDatabase -Type System.String[] + $CommandUnderTest | Should -HaveParameter AddDatabase } It "Should have SeedingMode as a parameter" { - $CommandUnderTest | Should -HaveParameter SeedingMode -Type System.String + $CommandUnderTest | Should -HaveParameter SeedingMode } It "Should have SharedPath as a parameter" { - $CommandUnderTest | Should -HaveParameter SharedPath -Type System.String + $CommandUnderTest | Should -HaveParameter SharedPath } It "Should have UseLastBackup as a parameter" { - $CommandUnderTest | Should -HaveParameter UseLastBackup -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter UseLastBackup } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaBackupEncrypted.Tests.ps1 b/tests/Test-DbaBackupEncrypted.Tests.ps1 index bde2ee975f..4cf3e41e58 100644 --- a/tests/Test-DbaBackupEncrypted.Tests.ps1 +++ b/tests/Test-DbaBackupEncrypted.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Test-DbaBackupEncrypted" { $CommandUnderTest = Get-Command Test-DbaBackupEncrypted } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have FilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String[] + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaBackupInformation.Tests.ps1 b/tests/Test-DbaBackupInformation.Tests.ps1 index 6c45033439..ddcf8d4f80 100644 --- a/tests/Test-DbaBackupInformation.Tests.ps1 +++ b/tests/Test-DbaBackupInformation.Tests.ps1 @@ -12,28 +12,28 @@ Describe "Test-DbaBackupInformation Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Test-DbaBackupInformation } It "Should have BackupHistory as a parameter" { - $CommandUnderTest | Should -HaveParameter BackupHistory -Type System.Object[] + $CommandUnderTest | Should -HaveParameter BackupHistory } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have WithReplace as a switch parameter" { - $CommandUnderTest | Should -HaveParameter WithReplace -Type switch + $CommandUnderTest | Should -HaveParameter WithReplace } It "Should have Continue as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Continue -Type switch + $CommandUnderTest | Should -HaveParameter Continue } It "Should have VerifyOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter VerifyOnly -Type switch + $CommandUnderTest | Should -HaveParameter VerifyOnly } It "Should have OutputScriptOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter OutputScriptOnly -Type switch + $CommandUnderTest | Should -HaveParameter OutputScriptOnly } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Test-DbaBuild.Tests.ps1 b/tests/Test-DbaBuild.Tests.ps1 index b72dc40f85..0f607c7108 100644 --- a/tests/Test-DbaBuild.Tests.ps1 +++ b/tests/Test-DbaBuild.Tests.ps1 @@ -6,31 +6,31 @@ Describe "Test-DbaBuild" { $CommandUnderTest = Get-Command Test-DbaBuild } It "Should have Build parameter" { - $CommandUnderTest | Should -HaveParameter Build -Type Microsoft.Version[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Build } It "Should have MinimumBuild parameter" { - $CommandUnderTest | Should -HaveParameter MinimumBuild -Type Microsoft.Version -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MinimumBuild } It "Should have MaxBehind parameter" { - $CommandUnderTest | Should -HaveParameter MaxBehind -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaxBehind } It "Should have Latest parameter" { - $CommandUnderTest | Should -HaveParameter Latest -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Latest } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Update parameter" { - $CommandUnderTest | Should -HaveParameter Update -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Update } It "Should have Quiet parameter" { - $CommandUnderTest | Should -HaveParameter Quiet -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Quiet } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaCmConnection.Tests.ps1 b/tests/Test-DbaCmConnection.Tests.ps1 index 181c169273..a08d5bc167 100644 --- a/tests/Test-DbaCmConnection.Tests.ps1 +++ b/tests/Test-DbaCmConnection.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Test-DbaCmConnection" { $CommandUnderTest = Get-Command Test-DbaCmConnection } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaCmConnectionParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] + $CommandUnderTest | Should -HaveParameter Type } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type switch + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaComputerCertificateExpiration.Tests.ps1 b/tests/Test-DbaComputerCertificateExpiration.Tests.ps1 index 9fb452ae26..1e97e12ba4 100644 --- a/tests/Test-DbaComputerCertificateExpiration.Tests.ps1 +++ b/tests/Test-DbaComputerCertificateExpiration.Tests.ps1 @@ -5,32 +5,32 @@ Describe "Test-DbaComputerCertificateExpiration" { BeforeAll { $CommandUnderTest = Get-Command Test-DbaComputerCertificateExpiration } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } - It "Should have Store as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Store -Type System.String[] -Mandatory:$false + It "Should have Store as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Store } - It "Should have Folder as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Folder -Type System.String[] -Mandatory:$false + It "Should have Folder as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Folder } - It "Should have Type as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Type -Type System.String -Mandatory:$false + It "Should have Type as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Type } - It "Should have Path as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Path -Type System.String -Mandatory:$false + It "Should have Path as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Path } - It "Should have Thumbprint as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Thumbprint -Type System.String[] -Mandatory:$false + It "Should have Thumbprint as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Thumbprint } - It "Should have Threshold as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter Threshold -Type System.Int32 -Mandatory:$false + It "Should have Threshold as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Threshold } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Test-DbaConnection.Tests.ps1 b/tests/Test-DbaConnection.Tests.ps1 index bc63bd3718..ffff8cd7f1 100644 --- a/tests/Test-DbaConnection.Tests.ps1 +++ b/tests/Test-DbaConnection.Tests.ps1 @@ -10,19 +10,19 @@ Describe "Test-DbaConnection" { $CommandUnderTest = Get-Command Test-DbaConnection } It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have SkipPSRemoting as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter SkipPSRemoting -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SkipPSRemoting } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaConnectionAuthScheme.Tests.ps1 b/tests/Test-DbaConnectionAuthScheme.Tests.ps1 index e6dc84adde..1aa0fd8f65 100644 --- a/tests/Test-DbaConnectionAuthScheme.Tests.ps1 +++ b/tests/Test-DbaConnectionAuthScheme.Tests.ps1 @@ -10,19 +10,19 @@ Describe "Test-DbaConnectionAuthScheme" { $CommandUnderTest = Get-Command Test-DbaConnectionAuthScheme } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Kerberos as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Kerberos -Type switch + $CommandUnderTest | Should -HaveParameter Kerberos } It "Should have Ntlm as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Ntlm -Type switch + $CommandUnderTest | Should -HaveParameter Ntlm } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaDbCollation.Tests.ps1 b/tests/Test-DbaDbCollation.Tests.ps1 index 36a159ba1f..696222177c 100644 --- a/tests/Test-DbaDbCollation.Tests.ps1 +++ b/tests/Test-DbaDbCollation.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Test-DbaDbCollation" { $CommandUnderTest = Get-Command Test-DbaDbCollation } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } @@ -26,11 +26,11 @@ Describe "Test-DbaDbCollation" { BeforeAll { $server = Connect-DbaInstance -SqlInstance $global:instance1 $db1 = "dbatoolsci_collation" - Get-DbaDatabase -SqlInstance $server -Database $db1 | Remove-DbaDatabase -Confirm:$false + Get-DbaDatabase -SqlInstance $server -Database $db1 | Remove-DbaDatabase $server.Query("CREATE DATABASE $db1") } AfterAll { - Get-DbaDatabase -SqlInstance $server -Database $db1 | Remove-DbaDatabase -Confirm:$false + Get-DbaDatabase -SqlInstance $server -Database $db1 | Remove-DbaDatabase } It "confirms the db is the same collation as the server" { diff --git a/tests/Test-DbaDbCompatibility.Tests.ps1 b/tests/Test-DbaDbCompatibility.Tests.ps1 index 5cb30d54de..91920831bf 100644 --- a/tests/Test-DbaDbCompatibility.Tests.ps1 +++ b/tests/Test-DbaDbCompatibility.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Test-DbaDbCompatibility" { $CommandUnderTest = Get-Command Test-DbaDbCompatibility } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaDbCompression.Tests.ps1 b/tests/Test-DbaDbCompression.Tests.ps1 index c6d9974cc4..044a1953a8 100644 --- a/tests/Test-DbaDbCompression.Tests.ps1 +++ b/tests/Test-DbaDbCompression.Tests.ps1 @@ -5,35 +5,35 @@ Describe "Test-DbaDbCompression Unit Tests" -Tag 'UnitTests' { BeforeAll { $CommandUnderTest = Get-Command Test-DbaDbCompression } - It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + It "Should have SqlInstance as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlInstance } - It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } - It "Should have Database as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] -Mandatory:$false + It "Should have Database as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Database } - It "Should have ExcludeDatabase as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] -Mandatory:$false + It "Should have ExcludeDatabase as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } - It "Should have Schema as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String[] -Mandatory:$false + It "Should have Schema as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Schema } - It "Should have Table as a non-mandatory parameter of type System.String[]" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String[] -Mandatory:$false + It "Should have Table as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Table } - It "Should have ResultSize as a non-mandatory parameter of type System.Int32" { - $CommandUnderTest | Should -HaveParameter ResultSize -Type System.Int32 -Mandatory:$false + It "Should have ResultSize as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ResultSize } - It "Should have Rank as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter Rank -Type System.String -Mandatory:$false + It "Should have Rank as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Rank } - It "Should have FilterBy as a non-mandatory parameter of type System.String" { - $CommandUnderTest | Should -HaveParameter FilterBy -Type System.String -Mandatory:$false + It "Should have FilterBy as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter FilterBy } - It "Should have EnableException as a non-mandatory parameter of type System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + It "Should have EnableException as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Test-DbaDbDataGeneratorConfig.Tests.ps1 b/tests/Test-DbaDbDataGeneratorConfig.Tests.ps1 index 6039520c48..a7941a2a5a 100644 --- a/tests/Test-DbaDbDataGeneratorConfig.Tests.ps1 +++ b/tests/Test-DbaDbDataGeneratorConfig.Tests.ps1 @@ -11,10 +11,10 @@ Describe "Test-DbaDbDataGeneratorConfig" { $CommandUnderTest = Get-Command Test-DbaDbDataGeneratorConfig } It "Should have FilePath as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaDbDataMaskingConfig.Tests.ps1 b/tests/Test-DbaDbDataMaskingConfig.Tests.ps1 index 5fb4d4f8c8..592c0fff2d 100644 --- a/tests/Test-DbaDbDataMaskingConfig.Tests.ps1 +++ b/tests/Test-DbaDbDataMaskingConfig.Tests.ps1 @@ -15,10 +15,10 @@ Describe "Test-DbaDbDataMaskingConfig" { $CommandUnderTest = Get-Command Test-DbaDbDataMaskingConfig } It "Should have FilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type System.String + $CommandUnderTest | Should -HaveParameter FilePath } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaDbLogShipStatus.Tests.ps1 b/tests/Test-DbaDbLogShipStatus.Tests.ps1 index c06e0be885..b777cc67b4 100644 --- a/tests/Test-DbaDbLogShipStatus.Tests.ps1 +++ b/tests/Test-DbaDbLogShipStatus.Tests.ps1 @@ -7,28 +7,28 @@ Describe "Test-DbaDbLogShipStatus Unit Tests" -Tag "UnitTests" { $CommandUnderTest = Get-Command $CommandName } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Simple as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Simple -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Simple } It "Should have Primary as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Primary -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Primary } It "Should have Secondary as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Secondary -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Secondary } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Test-DbaDbOwner.Tests.ps1 b/tests/Test-DbaDbOwner.Tests.ps1 index 5403166c9a..27c5d04976 100644 --- a/tests/Test-DbaDbOwner.Tests.ps1 +++ b/tests/Test-DbaDbOwner.Tests.ps1 @@ -10,25 +10,25 @@ Describe "Test-DbaDbOwner Unit Tests" -Tag "UnitTests" { $CommandUnderTest = Get-Command Test-DbaDbOwner } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have TargetLogin parameter" { - $CommandUnderTest | Should -HaveParameter TargetLogin -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter TargetLogin } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaDbQueryStore.Tests.ps1 b/tests/Test-DbaDbQueryStore.Tests.ps1 index 5bcdb4e1e9..cfc1deff2b 100644 --- a/tests/Test-DbaDbQueryStore.Tests.ps1 +++ b/tests/Test-DbaDbQueryStore.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Test-DbaDbQueryStore" { $CommandUnderTest = Get-Command Test-DbaDbQueryStore } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaDbRecoveryModel.Tests.ps1 b/tests/Test-DbaDbRecoveryModel.Tests.ps1 index b1c2abe254..3fe2ad4514 100644 --- a/tests/Test-DbaDbRecoveryModel.Tests.ps1 +++ b/tests/Test-DbaDbRecoveryModel.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Test-DbaDbRecoveryModel Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Test-DbaDbRecoveryModel } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have RecoveryModel as a parameter" { - $CommandUnderTest | Should -HaveParameter RecoveryModel -Type System.Object + $CommandUnderTest | Should -HaveParameter RecoveryModel } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Test-DbaDeprecatedFeature.Tests.ps1 b/tests/Test-DbaDeprecatedFeature.Tests.ps1 index c7e9085b5e..e0af674f9d 100644 --- a/tests/Test-DbaDeprecatedFeature.Tests.ps1 +++ b/tests/Test-DbaDeprecatedFeature.Tests.ps1 @@ -11,22 +11,22 @@ Describe "Test-DbaDeprecatedFeature" { $CommandUnderTest = Get-Command Test-DbaDeprecatedFeature } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.String[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaDiskAlignment.Tests.ps1 b/tests/Test-DbaDiskAlignment.Tests.ps1 index a3ebe223c8..73a61c9770 100644 --- a/tests/Test-DbaDiskAlignment.Tests.ps1 +++ b/tests/Test-DbaDiskAlignment.Tests.ps1 @@ -11,20 +11,20 @@ Describe "Test-DbaDiskAlignment" { BeforeAll { $CommandUnderTest = Get-Command Test-DbaDiskAlignment } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } - It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have SqlCredential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have NoSqlCheck as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter NoSqlCheck -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoSqlCheck } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaDiskAllocation.Tests.ps1 b/tests/Test-DbaDiskAllocation.Tests.ps1 index 0298f00b5e..27a02a6fae 100644 --- a/tests/Test-DbaDiskAllocation.Tests.ps1 +++ b/tests/Test-DbaDiskAllocation.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Test-DbaDiskAllocation" { $CommandUnderTest = Get-Command Test-DbaDiskAllocation } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have NoSqlCheck as a parameter" { - $CommandUnderTest | Should -HaveParameter NoSqlCheck -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoSqlCheck } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaDiskSpeed.Tests.ps1 b/tests/Test-DbaDiskSpeed.Tests.ps1 index 51cbd96bdc..5dbf5f4c10 100644 --- a/tests/Test-DbaDiskSpeed.Tests.ps1 +++ b/tests/Test-DbaDiskSpeed.Tests.ps1 @@ -11,22 +11,22 @@ Describe "Test-DbaDiskSpeed Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Test-DbaDiskSpeed } It "Should have SqlInstance as a non-mandatory Dataplat.Dbatools.Parameter.DbaInstanceParameter[] parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory System.Management.Automation.PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a non-mandatory System.Object[] parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a non-mandatory System.Object[] parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have AggregateBy as a non-mandatory System.String parameter" { - $CommandUnderTest | Should -HaveParameter AggregateBy -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AggregateBy } It "Should have EnableException as a non-mandatory System.Management.Automation.SwitchParameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Test-DbaEndpoint.Tests.ps1 b/tests/Test-DbaEndpoint.Tests.ps1 index 0f4bd6adc1..bc52bef6c8 100644 --- a/tests/Test-DbaEndpoint.Tests.ps1 +++ b/tests/Test-DbaEndpoint.Tests.ps1 @@ -10,19 +10,19 @@ Describe "Test-DbaEndpoint" { $CommandUnderTest = Get-Command Test-DbaEndpoint } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Endpoint as a parameter" { - $CommandUnderTest | Should -HaveParameter Endpoint -Type System.String[] + $CommandUnderTest | Should -HaveParameter Endpoint } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Endpoint[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaIdentityUsage.Tests.ps1 b/tests/Test-DbaIdentityUsage.Tests.ps1 index 2edf486cbe..7ae5563177 100644 --- a/tests/Test-DbaIdentityUsage.Tests.ps1 +++ b/tests/Test-DbaIdentityUsage.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Test-DbaIdentityUsage" { $CommandUnderTest = Get-Command Test-DbaIdentityUsage } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Threshold parameter" { - $CommandUnderTest | Should -HaveParameter Threshold -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Threshold } It "Should have ExcludeSystem parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystem -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeSystem } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaInstanceName.Tests.ps1 b/tests/Test-DbaInstanceName.Tests.ps1 index 61fabb4d11..7b054f7ab5 100644 --- a/tests/Test-DbaInstanceName.Tests.ps1 +++ b/tests/Test-DbaInstanceName.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Test-DbaInstanceName" { $CommandUnderTest = Get-Command Test-DbaInstanceName } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have ExcludeSsrs as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSsrs -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter ExcludeSsrs } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaLastBackup.Tests.ps1 b/tests/Test-DbaLastBackup.Tests.ps1 index f6363b7ef0..8fbb2c828f 100644 --- a/tests/Test-DbaLastBackup.Tests.ps1 +++ b/tests/Test-DbaLastBackup.Tests.ps1 @@ -12,85 +12,85 @@ Describe "Test-DbaLastBackup Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Test-DbaLastBackup } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type DbaInstanceParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have DataDirectory as a parameter" { - $CommandUnderTest | Should -HaveParameter DataDirectory -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DataDirectory } It "Should have LogDirectory as a parameter" { - $CommandUnderTest | Should -HaveParameter LogDirectory -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter LogDirectory } It "Should have FileStreamDirectory as a parameter" { - $CommandUnderTest | Should -HaveParameter FileStreamDirectory -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FileStreamDirectory } It "Should have Prefix as a parameter" { - $CommandUnderTest | Should -HaveParameter Prefix -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Prefix } It "Should have VerifyOnly as a parameter" { - $CommandUnderTest | Should -HaveParameter VerifyOnly -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter VerifyOnly } It "Should have NoCheck as a parameter" { - $CommandUnderTest | Should -HaveParameter NoCheck -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoCheck } It "Should have NoDrop as a parameter" { - $CommandUnderTest | Should -HaveParameter NoDrop -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoDrop } It "Should have CopyFile as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyFile -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CopyFile } It "Should have CopyPath as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyPath -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter CopyPath } It "Should have MaxSize as a parameter" { - $CommandUnderTest | Should -HaveParameter MaxSize -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaxSize } It "Should have DeviceType as a parameter" { - $CommandUnderTest | Should -HaveParameter DeviceType -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter DeviceType } It "Should have IncludeCopyOnly as a parameter" { - $CommandUnderTest | Should -HaveParameter IncludeCopyOnly -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IncludeCopyOnly } It "Should have IgnoreLogBackup as a parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreLogBackup -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IgnoreLogBackup } It "Should have AzureCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter AzureCredential -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter AzureCredential } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Database[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have MaxTransferSize as a parameter" { - $CommandUnderTest | Should -HaveParameter MaxTransferSize -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaxTransferSize } It "Should have BufferCount as a parameter" { - $CommandUnderTest | Should -HaveParameter BufferCount -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter BufferCount } It "Should have IgnoreDiffBackup as a parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreDiffBackup -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IgnoreDiffBackup } It "Should have MaxDop as a parameter" { - $CommandUnderTest | Should -HaveParameter MaxDop -Type System.Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter MaxDop } It "Should have ReuseSourceFolderStructure as a parameter" { - $CommandUnderTest | Should -HaveParameter ReuseSourceFolderStructure -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ReuseSourceFolderStructure } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Test-DbaLinkedServerConnection.Tests.ps1 b/tests/Test-DbaLinkedServerConnection.Tests.ps1 index 4262730ba9..90588332f8 100644 --- a/tests/Test-DbaLinkedServerConnection.Tests.ps1 +++ b/tests/Test-DbaLinkedServerConnection.Tests.ps1 @@ -11,13 +11,13 @@ Describe "Test-DbaLinkedServerConnection" { $CommandUnderTest = Get-Command Test-DbaLinkedServerConnection } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaLoginPassword.Tests.ps1 b/tests/Test-DbaLoginPassword.Tests.ps1 index 0c3610da4f..382d4d0c08 100644 --- a/tests/Test-DbaLoginPassword.Tests.ps1 +++ b/tests/Test-DbaLoginPassword.Tests.ps1 @@ -11,22 +11,22 @@ Describe "Test-DbaLoginPassword" { $CommandUnderTest = Get-Command Test-DbaLoginPassword } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Login parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String[] + $CommandUnderTest | Should -HaveParameter Login } It "Should have Dictionary parameter" { - $CommandUnderTest | Should -HaveParameter Dictionary -Type System.String[] + $CommandUnderTest | Should -HaveParameter Dictionary } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Login[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaLsnChain.Tests.ps1 b/tests/Test-DbaLsnChain.Tests.ps1 index 3c48341216..ce7c56fafd 100644 --- a/tests/Test-DbaLsnChain.Tests.ps1 +++ b/tests/Test-DbaLsnChain.Tests.ps1 @@ -11,13 +11,13 @@ Describe "Test-DbaLsnChain" { $CommandUnderTest = Get-Command Test-DbaLsnChain } It "Should have FilteredRestoreFiles as a parameter" { - $CommandUnderTest | Should -HaveParameter FilteredRestoreFiles -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FilteredRestoreFiles } It "Should have Continue as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Continue -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Continue } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaManagementObject.Tests.ps1 b/tests/Test-DbaManagementObject.Tests.ps1 index a9ef482ccc..745a44a685 100644 --- a/tests/Test-DbaManagementObject.Tests.ps1 +++ b/tests/Test-DbaManagementObject.Tests.ps1 @@ -11,17 +11,17 @@ Describe "Test-DbaManagementObject" { BeforeAll { $CommandUnderTest = Get-Command Test-DbaManagementObject } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } - It "Should have VersionNumber as a non-mandatory parameter of type System.Int32[]" { - $CommandUnderTest | Should -HaveParameter VersionNumber -Type System.Int32[] -Mandatory:$false + It "Should have VersionNumber as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter VersionNumber } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaMaxDop.Tests.ps1 b/tests/Test-DbaMaxDop.Tests.ps1 index 7439e7a711..f9d6984164 100644 --- a/tests/Test-DbaMaxDop.Tests.ps1 +++ b/tests/Test-DbaMaxDop.Tests.ps1 @@ -10,13 +10,13 @@ Describe "Test-DbaMaxDop" { $CommandUnderTest = Get-Command Test-DbaMaxDop } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Microsoft.SqlServer.Management.Smo.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaMaxMemory.Tests.ps1 b/tests/Test-DbaMaxMemory.Tests.ps1 index 361d80c2a1..3e2828c118 100644 --- a/tests/Test-DbaMaxMemory.Tests.ps1 +++ b/tests/Test-DbaMaxMemory.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Test-DbaMaxMemory" { $CommandUnderTest = Get-Command Test-DbaMaxMemory } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaMigrationConstraint.Tests.ps1 b/tests/Test-DbaMigrationConstraint.Tests.ps1 index bdc3691db6..026323a9de 100644 --- a/tests/Test-DbaMigrationConstraint.Tests.ps1 +++ b/tests/Test-DbaMigrationConstraint.Tests.ps1 @@ -28,25 +28,25 @@ Describe "Test-DbaMigrationConstraint" { $CommandUnderTest = Get-Command Test-DbaMigrationConstraint } It "Should have Source parameter" { - $CommandUnderTest | Should -HaveParameter Source -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Source } It "Should have SourceSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SourceSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SourceSqlCredential } It "Should have Destination parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter Destination } It "Should have DestinationSqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type System.Object[] + $CommandUnderTest | Should -HaveParameter ExcludeDatabase } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaNetworkLatency.Tests.ps1 b/tests/Test-DbaNetworkLatency.Tests.ps1 index dfdce8e042..db56547984 100644 --- a/tests/Test-DbaNetworkLatency.Tests.ps1 +++ b/tests/Test-DbaNetworkLatency.Tests.ps1 @@ -11,19 +11,19 @@ Describe "Test-DbaNetworkLatency" { $CommandUnderTest = Get-Command Test-DbaNetworkLatency } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Query as a parameter" { - $CommandUnderTest | Should -HaveParameter Query -Type System.String + $CommandUnderTest | Should -HaveParameter Query } It "Should have Count as a parameter" { - $CommandUnderTest | Should -HaveParameter Count -Type System.Int32 + $CommandUnderTest | Should -HaveParameter Count } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaOptimizeForAdHoc.Tests.ps1 b/tests/Test-DbaOptimizeForAdHoc.Tests.ps1 index fef5ae4774..ae66d3f834 100644 --- a/tests/Test-DbaOptimizeForAdHoc.Tests.ps1 +++ b/tests/Test-DbaOptimizeForAdHoc.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Test-DbaOptimizeForAdHoc" { $CommandUnderTest = Get-Command Test-DbaOptimizeForAdHoc } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaPath.Tests.ps1 b/tests/Test-DbaPath.Tests.ps1 index 04f6f5928d..a5ed167ea1 100644 --- a/tests/Test-DbaPath.Tests.ps1 +++ b/tests/Test-DbaPath.Tests.ps1 @@ -19,16 +19,16 @@ Describe "Test-DbaPath" { $CommandUnderTest = Get-Command Test-DbaPath } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type System.Object + $CommandUnderTest | Should -HaveParameter Path } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaPowerPlan.Tests.ps1 b/tests/Test-DbaPowerPlan.Tests.ps1 index 9da74dec66..cf04928a50 100644 --- a/tests/Test-DbaPowerPlan.Tests.ps1 +++ b/tests/Test-DbaPowerPlan.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Test-DbaPowerPlan" { $CommandUnderTest = Get-Command Test-DbaPowerPlan } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter Credential } It "Should have PowerPlan as a parameter" { - $CommandUnderTest | Should -HaveParameter PowerPlan -Type System.String + $CommandUnderTest | Should -HaveParameter PowerPlan } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaReplLatency.Tests.ps1 b/tests/Test-DbaReplLatency.Tests.ps1 index 8bf75ddae6..8eeece4333 100644 --- a/tests/Test-DbaReplLatency.Tests.ps1 +++ b/tests/Test-DbaReplLatency.Tests.ps1 @@ -12,28 +12,28 @@ Describe "Test-DbaReplLatency" { $CommandUnderTest = Get-Command Test-DbaReplLatency } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.Object[] + $CommandUnderTest | Should -HaveParameter Database } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have PublicationName parameter" { - $CommandUnderTest | Should -HaveParameter PublicationName -Type System.Object[] + $CommandUnderTest | Should -HaveParameter PublicationName } It "Should have TimeToLive parameter" { - $CommandUnderTest | Should -HaveParameter TimeToLive -Type System.Int32 + $CommandUnderTest | Should -HaveParameter TimeToLive } It "Should have RetainToken parameter" { - $CommandUnderTest | Should -HaveParameter RetainToken -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter RetainToken } It "Should have DisplayTokenHistory parameter" { - $CommandUnderTest | Should -HaveParameter DisplayTokenHistory -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter DisplayTokenHistory } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaSpn.Tests.ps1 b/tests/Test-DbaSpn.Tests.ps1 index 4fe8eb5587..635516bcbb 100644 --- a/tests/Test-DbaSpn.Tests.ps1 +++ b/tests/Test-DbaSpn.Tests.ps1 @@ -9,14 +9,14 @@ Describe "Test-DbaSpn" { BeforeAll { $CommandUnderTest = Get-Command Test-DbaSpn } - It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + It "Should have ComputerName as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter ComputerName } - It "Should have Credential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Management.Automation.PSCredential -Mandatory:$false + It "Should have Credential as a non-mandatory parameter" { + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaTempDbConfig.Tests.ps1 b/tests/Test-DbaTempDbConfig.Tests.ps1 index 550ed1d09d..ada5885042 100644 --- a/tests/Test-DbaTempDbConfig.Tests.ps1 +++ b/tests/Test-DbaTempDbConfig.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Test-DbaTempDbConfig" { $CommandUnderTest = Get-Command Test-DbaTempDbConfig } It "Should have SqlInstance as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a non-mandatory parameter of type System.Management.Automation.PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-DbaWindowsLogin.Tests.ps1 b/tests/Test-DbaWindowsLogin.Tests.ps1 index 2d1939966f..9c2b6c6677 100644 --- a/tests/Test-DbaWindowsLogin.Tests.ps1 +++ b/tests/Test-DbaWindowsLogin.Tests.ps1 @@ -12,28 +12,28 @@ Describe "Test-DbaWindowsLogin" { $CommandUnderTest = Get-Command Test-DbaWindowsLogin } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Login parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Login } It "Should have ExcludeLogin parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeLogin -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ExcludeLogin } It "Should have FilterBy parameter" { - $CommandUnderTest | Should -HaveParameter FilterBy -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FilterBy } It "Should have IgnoreDomains parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreDomains -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter IgnoreDomains } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Login[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Test-PSRemoting.Tests.ps1 b/tests/Test-PSRemoting.Tests.ps1 index f0fea38fb7..1ed2fea115 100644 --- a/tests/Test-PSRemoting.Tests.ps1 +++ b/tests/Test-PSRemoting.Tests.ps1 @@ -11,13 +11,13 @@ Describe "Test-PSRemoting" { $CommandUnderTest = Get-Command Test-PSRemoting } It "Should have ComputerName as a non-mandatory parameter of type Dataplat.Dbatools.Parameter.DbaInstanceParameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a non-mandatory parameter of type System.Object" { - $CommandUnderTest | Should -HaveParameter Credential -Type System.Object -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Uninstall-DbaSqlWatch.Tests.ps1 b/tests/Uninstall-DbaSqlWatch.Tests.ps1 index 7f6207809d..8a96df36cb 100644 --- a/tests/Uninstall-DbaSqlWatch.Tests.ps1 +++ b/tests/Uninstall-DbaSqlWatch.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Uninstall-DbaSqlWatch" { $CommandUnderTest = Get-Command Uninstall-DbaSqlWatch } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Unregister-DbatoolsConfig.Tests.ps1 b/tests/Unregister-DbatoolsConfig.Tests.ps1 index bda59ac12e..5405ac7340 100644 --- a/tests/Unregister-DbatoolsConfig.Tests.ps1 +++ b/tests/Unregister-DbatoolsConfig.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Unregister-DbatoolsConfig" { $CommandUnderTest = Get-Command Unregister-DbatoolsConfig } It "Accepts ConfigurationItem as a parameter" { - $CommandUnderTest | Should -HaveParameter ConfigurationItem -Type Dataplat.Dbatools.Configuration.Config[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ConfigurationItem } It "Accepts FullName as a parameter" { - $CommandUnderTest | Should -HaveParameter FullName -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter FullName } It "Accepts Module as a parameter" { - $CommandUnderTest | Should -HaveParameter Module -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Module } It "Accepts Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Name } It "Accepts Scope as a parameter" { - $CommandUnderTest | Should -HaveParameter Scope -Type Dataplat.Dbatools.Configuration.ConfigScope -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Scope } } diff --git a/tests/Update-DbaBuildReference.Tests.ps1 b/tests/Update-DbaBuildReference.Tests.ps1 index c9e57d3521..1dd62f059e 100644 --- a/tests/Update-DbaBuildReference.Tests.ps1 +++ b/tests/Update-DbaBuildReference.Tests.ps1 @@ -11,10 +11,10 @@ Describe "Update-DbaBuildReference" { $CommandUnderTest = Get-Command Update-DbaBuildReference } It "Should have LocalFile as a parameter" { - $CommandUnderTest | Should -HaveParameter LocalFile -Type System.String + $CommandUnderTest | Should -HaveParameter LocalFile } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Update-DbaInstance.Tests.ps1 b/tests/Update-DbaInstance.Tests.ps1 index bb9c72461e..6297466da6 100644 --- a/tests/Update-DbaInstance.Tests.ps1 +++ b/tests/Update-DbaInstance.Tests.ps1 @@ -71,13 +71,13 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' { It "should call internal functions using CredSSP" { $password = 'pwd' | ConvertTo-SecureString -AsPlainText -Force $cred = [System.Management.Automation.PSCredential]::new('usr', $password) - $null = Update-DbaInstance -ComputerName 'mocked' -Credential $cred -Version "2012SP3" -Path 'mocked' -EnableException -Confirm:$false + $null = Update-DbaInstance -ComputerName 'mocked' -Credential $cred -Version "2012SP3" -Path 'mocked' -EnableException -Confirm Assert-MockCalled -ParameterFilter { $Authentication -eq 'CredSSP' } -CommandName Find-SqlInstanceUpdate -Exactly 1 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Initialize-CredSSP -Exactly 1 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Invoke-Program -ParameterFilter { $Authentication -eq 'CredSSP' } -Exactly 2 -Scope It -ModuleName dbatools } It "should call internal functions using Default" { - $null = Update-DbaInstance -ComputerName 'mocked' -Version "2012SP3" -Path 'mocked' -EnableException -Confirm:$false + $null = Update-DbaInstance -ComputerName 'mocked' -Version "2012SP3" -Path 'mocked' -EnableException -Confirm Assert-MockCalled -ParameterFilter { $Authentication -eq 'Default' } -CommandName Find-SqlInstanceUpdate -Exactly 1 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Initialize-CredSSP -Exactly 0 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Invoke-Program -ParameterFilter { $Authentication -eq 'Default' } -Exactly 2 -Scope It -ModuleName dbatools @@ -85,7 +85,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' { It "should call internal functions using Kerberos" { $password = 'pwd' | ConvertTo-SecureString -AsPlainText -Force $cred = [System.Management.Automation.PSCredential]::new('usr', $password) - $null = Update-DbaInstance -ComputerName 'mocked' -Authentication Kerberos -Credential $cred -Version "2012SP3" -Path 'mocked' -EnableException -Confirm:$false + $null = Update-DbaInstance -ComputerName 'mocked' -Authentication Kerberos -Credential $cred -Version "2012SP3" -Path 'mocked' -EnableException -Confirm Assert-MockCalled -ParameterFilter { $Authentication -eq 'Kerberos' } -CommandName Find-SqlInstanceUpdate -Exactly 1 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Initialize-CredSSP -Exactly 0 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Invoke-Program -ParameterFilter { $Authentication -eq 'Kerberos' } -Exactly 2 -Scope It -ModuleName dbatools @@ -166,7 +166,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' { } } It "Should mock-upgrade SQL2017\LAB0 to SP0CU12 thinking it's latest" { - $result = Update-DbaInstance -Version 2017 -Path $exeDir -Restart -EnableException -Confirm:$false + $result = Update-DbaInstance -Version 2017 -Path $exeDir -Restart -EnableException -Confirm Assert-MockCalled -CommandName Get-SQLInstanceComponent -Exactly 1 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Test-DbaBuild -Exactly 2 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Invoke-Program -Exactly 2 -Scope It -ModuleName dbatools @@ -183,7 +183,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' { $result.ExtractPath | Should -BeLike '*\dbatools_KB*Extract_*' } It "Should mock-upgrade SQL2008\LAB2 to latest SP" { - $result = Update-DbaInstance -Version 2008 -InstanceName LAB2 -Type ServicePack -Path $exeDir -Restart -EnableException -Confirm:$false + $result = Update-DbaInstance -Version 2008 -InstanceName LAB2 -Path $exeDir -Restart -EnableException -Confirm Assert-MockCalled -CommandName Test-DbaBuild -Exactly 0 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Get-SQLInstanceComponent -Exactly 1 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Invoke-Program -Exactly 2 -Scope It -ModuleName dbatools @@ -201,7 +201,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' { $result.ExtractPath | Should -BeLike '*\dbatools_KB*Extract_*' } It "Should mock-upgrade SQL2008\LAB2 passing extra command line parameters" { - $result = Update-DbaInstance -Version 2008 -InstanceName LAB2 -Type ServicePack -Path $exeDir -ArgumentList @("/foo", "/bar=foobar") -EnableException -Confirm:$false + $result = Update-DbaInstance -Version 2008 -InstanceName LAB2 -Path $exeDir -ArgumentList @("/foo", "/bar=foobar") -EnableException -Confirm Assert-MockCalled -CommandName Test-DbaBuild -Exactly 0 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Get-SQLInstanceComponent -Exactly 1 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Invoke-Program -Exactly 1 -Scope It -ModuleName dbatools -ParameterFilter { @@ -222,7 +222,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' { $result.ExtractPath | Should -BeLike '*\dbatools_KB*Extract_*' } It "Should mock-upgrade two versions to latest SPs" { - $results = Update-DbaInstance -Version 2008, 2012 -Type ServicePack -Path $exeDir -Restart -EnableException -Confirm:$false + $results = Update-DbaInstance -Version 2008, 2012 -Path $exeDir -Restart -EnableException -Confirm Assert-MockCalled -CommandName Test-DbaBuild -Exactly 0 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Get-SQLInstanceComponent -Exactly 1 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Invoke-Program -Exactly 4 -Scope It -ModuleName dbatools @@ -306,7 +306,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' { } } It "Should mock-upgrade SQL2008 to SP3 (KB2546951)" { - $result = Update-DbaInstance -Kb KB2546951 -Path $exeDir -Restart -EnableException -Confirm:$false + $result = Update-DbaInstance -Kb KB2546951 -Path $exeDir -Restart -EnableException -Confirm Assert-MockCalled -CommandName Get-SQLInstanceComponent -Exactly 1 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Invoke-Program -Exactly 2 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Restart-Computer -Exactly 1 -Scope It -ModuleName dbatools @@ -322,7 +322,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' { $result.ExtractPath | Should -BeLike '*\dbatools_KB*Extract_*' } It "Should mock-upgrade SQL2016 to SP1CU4 (KB3182545 + KB4024305) " { - $result = Update-DbaInstance -Kb 3182545, 4024305 -Path $exeDir -Restart -EnableException -Confirm:$false + $result = Update-DbaInstance -Kb 3182545, 4024305 -Path $exeDir -Restart -EnableException -Confirm Assert-MockCalled -CommandName Get-SQLInstanceComponent -Exactly 1 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Invoke-Program -Exactly 2 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Restart-Computer -Exactly 1 -Scope It -ModuleName dbatools @@ -338,7 +338,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' { $result.ExtractPath | Should -BeLike '*\dbatools_KB*Extract_*' } It "Should mock-upgrade both versions to different KBs" { - $results = Update-DbaInstance -Kb 3182545, 4040714, KB2546951, KB2738350 -Path $exeDir -Restart -EnableException -Confirm:$false + $results = Update-DbaInstance -Kb 3182545, 4040714, KB2546951, KB2738350 -Path $exeDir -Restart -EnableException -Confirm Assert-MockCalled -CommandName Get-SQLInstanceComponent -Exactly 1 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Invoke-Program -Exactly 6 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Restart-Computer -Exactly 3 -Scope It -ModuleName dbatools @@ -442,7 +442,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' { } } It "Should mock-upgrade two SQL2016 servers to SP2" { - $results = Update-DbaInstance -ComputerName 'localhost', '127.0.0.1' -Version SQL2016SP2 -Path $exeDir -Restart -EnableException -Confirm:$false + $results = Update-DbaInstance -ComputerName 'localhost', '127.0.0.1' -Version SQL2016SP2 -Path $exeDir -Restart -EnableException -Confirm Assert-MockCalled -CommandName Get-SQLInstanceComponent -Exactly 2 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Invoke-Program -Exactly 4 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Restart-Computer -Exactly 2 -Scope It -ModuleName dbatools @@ -488,7 +488,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' { Mock -CommandName Get-Item -ModuleName dbatools -MockWith { 'c:\mocked' } } It "Should mock-upgrade interrupted setup of SQL2012 SP2" { - $result = Update-DbaInstance -Continue -InstanceName LAB -Version 2012SP2 -Path $exeDir -Restart -EnableException -Confirm:$false + $result = Update-DbaInstance -Continue -InstanceName LAB -Version 2012SP2 -Path $exeDir -Restart -EnableException -Confirm Assert-MockCalled -CommandName Get-SQLInstanceComponent -Exactly 1 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Invoke-Program -Exactly 2 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Restart-Computer -Exactly 1 -Scope It -ModuleName dbatools @@ -535,7 +535,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' { } } It "Should download and mock-upgrade SQL2012 KB3045321" { - $result = Update-DbaInstance -InstanceName LAB -KB KB3045321 -Path $exeDir -Download -EnableException -Confirm:$false + $result = Update-DbaInstance -InstanceName LAB -KB KB3045321 -Path $exeDir -Download -EnableException -Confirm Assert-MockCalled -CommandName Get-SQLInstanceComponent -Exactly 1 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Invoke-Program -Exactly 2 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Save-DbaKbUpdate -Exactly 1 -Scope It -ModuleName dbatools -ParameterFilter { @@ -723,7 +723,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' { $cuLevel = $tLevel } It "$v to $cuLevel" { - $results = Update-DbaInstance -Version "$v$cuLevel" -Path 'mocked' -Restart -EnableException -Confirm:$false + $results = Update-DbaInstance -Version "$v$cuLevel" -Path 'mocked' -Restart -EnableException -Confirm Assert-MockCalled -CommandName Get-SQLInstanceComponent -Exactly 1 -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Invoke-Program -Exactly ($steps * 2) -Scope It -ModuleName dbatools Assert-MockCalled -CommandName Restart-Computer -Exactly $steps -Scope It -ModuleName dbatools diff --git a/tests/Update-DbaMaintenanceSolution.Tests.ps1 b/tests/Update-DbaMaintenanceSolution.Tests.ps1 index c9ef79f3f6..a69cdd7a66 100644 --- a/tests/Update-DbaMaintenanceSolution.Tests.ps1 +++ b/tests/Update-DbaMaintenanceSolution.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Update-DbaMaintenanceSolution" { $CommandUnderTest = Get-Command Update-DbaMaintenanceSolution } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have Solution parameter" { - $CommandUnderTest | Should -HaveParameter Solution -Type System.String[] + $CommandUnderTest | Should -HaveParameter Solution } It "Should have LocalFile parameter" { - $CommandUnderTest | Should -HaveParameter LocalFile -Type System.String + $CommandUnderTest | Should -HaveParameter LocalFile } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Force } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Update-DbaServiceAccount.Tests.ps1 b/tests/Update-DbaServiceAccount.Tests.ps1 index d02b9c7f1d..e72f9a7cde 100644 --- a/tests/Update-DbaServiceAccount.Tests.ps1 +++ b/tests/Update-DbaServiceAccount.Tests.ps1 @@ -74,34 +74,34 @@ Describe "Update-DbaServiceAccount" { $CommandUnderTest = Get-Command Update-DbaServiceAccount } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type Dataplat.Dbatools.Connection.ManagementConnectionType[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ComputerName } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type Microsoft.SqlServer.Management.Smo.Credential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Credential } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have ServiceName as a parameter" { - $CommandUnderTest | Should -HaveParameter ServiceName -Type System.String[] -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ServiceName } It "Should have Username as a parameter" { - $CommandUnderTest | Should -HaveParameter Username -Type System.String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Username } It "Should have ServiceCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter ServiceCredential -Type Microsoft.SqlServer.Management.Smo.Credential -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ServiceCredential } It "Should have PreviousPassword as a parameter" { - $CommandUnderTest | Should -HaveParameter PreviousPassword -Type System.Security.SecureString -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PreviousPassword } It "Should have SecurePassword as a parameter" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type System.Security.SecureString -Mandatory:$false + $CommandUnderTest | Should -HaveParameter SecurePassword } It "Should have NoRestart as a parameter" { - $CommandUnderTest | Should -HaveParameter NoRestart -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter NoRestart } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter -Mandatory:$false + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Update-dbatools.Tests.ps1 b/tests/Update-dbatools.Tests.ps1 index 6008ff77a5..94f83e588b 100644 --- a/tests/Update-dbatools.Tests.ps1 +++ b/tests/Update-dbatools.Tests.ps1 @@ -12,13 +12,13 @@ Describe "Update-Dbatools" { $CommandUnderTest = Get-Command Update-Dbatools } It "Should have Development as a Switch" { - $CommandUnderTest | Should -HaveParameter Development -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Development } It "Should have Cleanup as a Switch" { - $CommandUnderTest | Should -HaveParameter Cleanup -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Cleanup } It "Should have EnableException as a Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } } diff --git a/tests/Watch-DbaDbLogin.Tests.ps1 b/tests/Watch-DbaDbLogin.Tests.ps1 index 29dba80622..bfe36c0f5f 100644 --- a/tests/Watch-DbaDbLogin.Tests.ps1 +++ b/tests/Watch-DbaDbLogin.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Watch-DbaDbLogin" { $CommandUnderTest = Get-Command Watch-DbaDbLogin } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter[] + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type System.String + $CommandUnderTest | Should -HaveParameter Database } It "Should have Table as a parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String + $CommandUnderTest | Should -HaveParameter Table } It "Should have SqlCms as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCms -Type System.String + $CommandUnderTest | Should -HaveParameter SqlCms } It "Should have ServersFromFile as a parameter" { - $CommandUnderTest | Should -HaveParameter ServersFromFile -Type System.String + $CommandUnderTest | Should -HaveParameter ServersFromFile } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.Smo.Server[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Watch-DbaXESession.Tests.ps1 b/tests/Watch-DbaXESession.Tests.ps1 index 4003a06185..df094c8059 100644 --- a/tests/Watch-DbaXESession.Tests.ps1 +++ b/tests/Watch-DbaXESession.Tests.ps1 @@ -10,22 +10,22 @@ Describe "Watch-DbaXESession" { $CommandUnderTest = Get-Command Watch-DbaXESession } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Parameter.DbaInstanceParameter + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Session parameter" { - $CommandUnderTest | Should -HaveParameter Session -Type System.String + $CommandUnderTest | Should -HaveParameter Session } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Microsoft.SqlServer.Management.XEvent.Session[] + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Raw parameter" { - $CommandUnderTest | Should -HaveParameter Raw -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Raw } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } } diff --git a/tests/Write-DbaDbTableData.Tests.ps1 b/tests/Write-DbaDbTableData.Tests.ps1 index edf405bde0..799c0110b0 100644 --- a/tests/Write-DbaDbTableData.Tests.ps1 +++ b/tests/Write-DbaDbTableData.Tests.ps1 @@ -21,61 +21,61 @@ Describe "Write-DbaDbTableData" { $CommandUnderTest = Get-Command Write-DbaDbTableData } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type Dataplat.Dbatools.Connection.ManagementConnectionType + $CommandUnderTest | Should -HaveParameter SqlInstance } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type System.Management.Automation.PSCredential + $CommandUnderTest | Should -HaveParameter SqlCredential } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Microsoft.SqlServer.Management.Smo.Database + $CommandUnderTest | Should -HaveParameter Database } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type System.Object + $CommandUnderTest | Should -HaveParameter InputObject } It "Should have Table parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type System.String + $CommandUnderTest | Should -HaveParameter Table } It "Should have Schema parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type System.String + $CommandUnderTest | Should -HaveParameter Schema } It "Should have BatchSize parameter" { - $CommandUnderTest | Should -HaveParameter BatchSize -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BatchSize } It "Should have NotifyAfter parameter" { - $CommandUnderTest | Should -HaveParameter NotifyAfter -Type System.Int32 + $CommandUnderTest | Should -HaveParameter NotifyAfter } It "Should have AutoCreateTable parameter" { - $CommandUnderTest | Should -HaveParameter AutoCreateTable -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter AutoCreateTable } It "Should have NoTableLock parameter" { - $CommandUnderTest | Should -HaveParameter NoTableLock -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter NoTableLock } It "Should have CheckConstraints parameter" { - $CommandUnderTest | Should -HaveParameter CheckConstraints -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter CheckConstraints } It "Should have FireTriggers parameter" { - $CommandUnderTest | Should -HaveParameter FireTriggers -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter FireTriggers } It "Should have KeepIdentity parameter" { - $CommandUnderTest | Should -HaveParameter KeepIdentity -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter KeepIdentity } It "Should have KeepNulls parameter" { - $CommandUnderTest | Should -HaveParameter KeepNulls -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter KeepNulls } It "Should have Truncate parameter" { - $CommandUnderTest | Should -HaveParameter Truncate -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter Truncate } It "Should have BulkCopyTimeOut parameter" { - $CommandUnderTest | Should -HaveParameter BulkCopyTimeOut -Type System.Int32 + $CommandUnderTest | Should -HaveParameter BulkCopyTimeOut } It "Should have ColumnMap parameter" { - $CommandUnderTest | Should -HaveParameter ColumnMap -Type System.Collections.Hashtable + $CommandUnderTest | Should -HaveParameter ColumnMap } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter EnableException } It "Should have UseDynamicStringLength parameter" { - $CommandUnderTest | Should -HaveParameter UseDynamicStringLength -Type System.Management.Automation.SwitchParameter + $CommandUnderTest | Should -HaveParameter UseDynamicStringLength } } diff --git a/tests/dbatools.Tests.ps1 b/tests/dbatools.Tests.ps1 index e991b41a71..be32dce296 100644 --- a/tests/dbatools.Tests.ps1 +++ b/tests/dbatools.Tests.ps1 @@ -311,4 +311,4 @@ $global:Manifest = Test-ModuleManifest -Path $ManifestPath -ErrorAction Silently } } -#> \ No newline at end of file +#>