From 9f6819d2f7518f7e8faebb41dac18b89e4dace89 Mon Sep 17 00:00:00 2001 From: Chrissy LeMaire Date: Thu, 17 Oct 2024 14:02:35 +0200 Subject: [PATCH] change the way it ensures something is not mandatory --- tests/Add-DbaAgDatabase.Tests.ps1 | 24 ++--- tests/Add-DbaAgListener.Tests.ps1 | 24 ++--- tests/Add-DbaExtendedProperty.Tests.ps1 | 14 +-- tests/Add-DbaPfDataCollectorCounter.Tests.ps1 | 14 +-- tests/Add-DbaRegServer.Tests.ps1 | 26 ++--- tests/Backup-DbaComputerCertificate.Tests.ps1 | 12 +-- tests/Backup-DbaDatabase.Tests.ps1 | 36 +++---- tests/Backup-DbaDbMasterKey.Tests.ps1 | 18 ++-- tests/Backup-DbaServiceMasterKey.Tests.ps1 | 40 +++---- tests/Clear-DbaConnectionPool.Tests.ps1 | 30 +++--- tests/Clear-DbaLatchStatistics.Tests.ps1 | 34 +++--- tests/Clear-DbaPlanCache.Tests.ps1 | 10 +- tests/Connect-DbaInstance.Tests.ps1 | 64 +++++------ tests/ConvertTo-DbaDataTable.Tests.ps1 | 6 +- tests/ConvertTo-DbaTimeline.Tests.ps1 | 6 +- tests/Copy-DbaDbAssembly.Tests.ps1 | 16 +-- tests/Copy-DbaXESessionTemplate.Tests.ps1 | 6 +- ...isable-DbaForceNetworkEncryption.Tests.ps1 | 6 +- tests/Disable-DbaReplDistributor.Tests.ps1 | 8 +- tests/Disable-DbaReplPublishing.Tests.ps1 | 8 +- tests/Disable-DbaStartupProcedure.Tests.ps1 | 10 +- tests/Disconnect-DbaInstance.Tests.ps1 | 32 +++--- tests/Enable-DbaAgHadr.Tests.ps1 | 8 +- tests/Enable-DbaDbEncryption.Tests.ps1 | 14 +-- ...Enable-DbaForceNetworkEncryption.Tests.ps1 | 6 +- tests/Enable-DbaReplDistributor.Tests.ps1 | 36 +++---- tests/Enable-DbaReplPublishing.Tests.ps1 | 38 +++---- tests/Export-DbaBinaryFile.Tests.ps1 | 24 ++--- tests/Export-DbaCredential.Tests.ps1 | 20 ++-- tests/Export-DbaDacPackage.Tests.ps1 | 26 ++--- tests/Export-DbaDbRole.Tests.ps1 | 36 +++---- tests/Export-DbaDbTableData.Tests.ps1 | 20 ++-- tests/Export-DbaDiagnosticQuery.Tests.ps1 | 14 +-- tests/Export-DbaInstance.Tests.ps1 | 28 ++--- ...rt-DbaPfDataCollectorSetTemplate.Tests.ps1 | 14 +-- tests/Export-DbaReplServerSetting.Tests.ps1 | 22 ++-- tests/Export-DbaServerRole.Tests.ps1 | 34 +++--- tests/Export-DbaSpConfigure.Tests.ps1 | 10 +- tests/Export-DbaUser.Tests.ps1 | 34 +++--- tests/Export-DbaXESessionTemplate.Tests.ps1 | 14 +-- tests/Export-DbatoolsConfig.Tests.ps1 | 20 ++-- tests/Find-DbaCommand.Tests.ps1 | 14 +-- tests/Find-DbaDatabase.Tests.ps1 | 12 +-- tests/Find-DbaDbDisabledIndex.Tests.ps1 | 14 +-- tests/Find-DbaInstance.Tests.ps1 | 20 ++-- tests/Find-DbaSimilarTable.Tests.ps1 | 20 ++-- tests/Get-DbaAgBackupHistory.Tests.ps1 | 40 +++---- tests/Get-DbaAgDatabase.Tests.ps1 | 12 +-- tests/Get-DbaAgReplica.Tests.ps1 | 12 +-- tests/Get-DbaAgentJob.Tests.ps1 | 22 ++-- tests/Get-DbaAgentJobHistory.Tests.ps1 | 22 ++-- tests/Get-DbaAgentSchedule.Tests.ps1 | 12 +-- tests/Get-DbaAgentServer.Tests.ps1 | 30 +++--- tests/Get-DbaBackupDevice.Tests.ps1 | 6 +- tests/Get-DbaBackupInformation.Tests.ps1 | 36 +++---- tests/Get-DbaBuild.Tests.ps1 | 18 ++-- tests/Get-DbaClientAlias.Tests.ps1 | 6 +- tests/Get-DbaCmConnection.Tests.ps1 | 6 +- tests/Get-DbaCmObject.Tests.ps1 | 18 ++-- tests/Get-DbaComputerCertificate.Tests.ps1 | 16 +-- tests/Get-DbaConnectedInstance.Tests.ps1 | 24 ++--- tests/Get-DbaConnection.Tests.ps1 | 6 +- tests/Get-DbaCustomError.Tests.ps1 | 6 +- tests/Get-DbaDBFileGroup.Tests.ps1 | 12 +-- tests/Get-DbaDatabase.Tests.ps1 | 36 +++---- tests/Get-DbaDbBackupHistory.Tests.ps1 | 42 ++++---- tests/Get-DbaDbCertificate.Tests.ps1 | 16 +-- tests/Get-DbaDbCheckConstraint.Tests.ps1 | 12 +-- tests/Get-DbaDbCompression.Tests.ps1 | 12 +-- tests/Get-DbaDbEncryptionKey.Tests.ps1 | 12 +-- tests/Get-DbaDbFile.Tests.ps1 | 14 +-- tests/Get-DbaDbFileGrowth.Tests.ps1 | 34 +++--- tests/Get-DbaDbLogShipError.Tests.ps1 | 20 ++-- tests/Get-DbaDbLogSpace.Tests.ps1 | 12 +-- tests/Get-DbaDbMail.Tests.ps1 | 6 +- tests/Get-DbaDbMailAccount.Tests.ps1 | 12 +-- tests/Get-DbaDbMailConfig.Tests.ps1 | 10 +- tests/Get-DbaDbMailProfile.Tests.ps1 | 12 +-- tests/Get-DbaDbMailServer.Tests.ps1 | 12 +-- tests/Get-DbaDbMirror.Tests.ps1 | 8 +- tests/Get-DbaDbMirrorMonitor.Tests.ps1 | 14 +-- tests/Get-DbaDbPageInfo.Tests.ps1 | 14 +-- tests/Get-DbaDbPartitionFunction.Tests.ps1 | 12 +-- tests/Get-DbaDbPartitionScheme.Tests.ps1 | 12 +-- tests/Get-DbaDbRecoveryModel.Tests.ps1 | 12 +-- tests/Get-DbaDbRole.Tests.ps1 | 18 ++-- tests/Get-DbaDbRoleMember.Tests.ps1 | 20 ++-- tests/Get-DbaDbSpace.Tests.ps1 | 14 +-- tests/Get-DbaDbStoredProcedure.Tests.ps1 | 18 ++-- tests/Get-DbaDbTrigger.Tests.ps1 | 12 +-- tests/Get-DbaDbccHelp.Tests.ps1 | 10 +- tests/Get-DbaDbccMemoryStatus.Tests.ps1 | 6 +- tests/Get-DbaDbccProcCache.Tests.ps1 | 30 +++--- tests/Get-DbaDbccUserOption.Tests.ps1 | 8 +- tests/Get-DbaDefaultPath.Tests.ps1 | 6 +- tests/Get-DbaDependency.Tests.ps1 | 10 +- tests/Get-DbaDeprecatedFeature.Tests.ps1 | 30 +++--- tests/Get-DbaErrorLogConfig.Tests.ps1 | 30 +++--- .../Get-DbaEstimatedCompletionTime.Tests.ps1 | 10 +- tests/Get-DbaExtendedProtection.Tests.ps1 | 34 +++--- tests/Get-DbaFile.Tests.ps1 | 12 +-- tests/Get-DbaFilestream.Tests.ps1 | 8 +- tests/Get-DbaHideInstance.Tests.ps1 | 30 +++--- tests/Get-DbaInstalledPatch.Tests.ps1 | 30 +++--- ...et-DbaInstanceAuditSpecification.Tests.ps1 | 30 +++--- tests/Get-DbaInstanceProperty.Tests.ps1 | 10 +- tests/Get-DbaInstanceProtocol.Tests.ps1 | 6 +- tests/Get-DbaInstanceTrigger.Tests.ps1 | 30 +++--- tests/Get-DbaIoLatency.Tests.ps1 | 30 +++--- tests/Get-DbaKbUpdate.Tests.ps1 | 8 +- tests/Get-DbaLastBackup.Tests.ps1 | 10 +- tests/Get-DbaLatchStatistic.Tests.ps1 | 8 +- tests/Get-DbaLinkedServer.Tests.ps1 | 10 +- tests/Get-DbaLinkedServerLogin.Tests.ps1 | 14 +-- tests/Get-DbaLocaleSetting.Tests.ps1 | 30 +++--- tests/Get-DbaLogin.Tests.ps1 | 28 ++--- tests/Get-DbaMaxMemory.Tests.ps1 | 6 +- tests/Get-DbaMemoryCondition.Tests.ps1 | 30 +++--- tests/Get-DbaModule.Tests.ps1 | 20 ++-- tests/Get-DbaMsdtc.Tests.ps1 | 6 +- tests/Get-DbaNetworkActivity.Tests.ps1 | 30 +++--- tests/Get-DbaOleDbProvider.Tests.ps1 | 32 +++--- tests/Get-DbaPageFileSetting.Tests.ps1 | 30 +++--- tests/Get-DbaPbmCategory.Tests.ps1 | 12 +-- .../Get-DbaPbmCategorySubscription.Tests.ps1 | 32 +++--- tests/Get-DbaPbmCondition.Tests.ps1 | 12 +-- tests/Get-DbaPbmStore.Tests.ps1 | 30 +++--- tests/Get-DbaPermission.Tests.ps1 | 14 +-- tests/Get-DbaPfDataCollectorSet.Tests.ps1 | 8 +- ...et-DbaPfDataCollectorSetTemplate.Tests.ps1 | 8 +- tests/Get-DbaPrivilege.Tests.ps1 | 6 +- tests/Get-DbaProcess.Tests.ps1 | 20 ++-- tests/Get-DbaProductKey.Tests.ps1 | 8 +- tests/Get-DbaQueryExecutionTime.Tests.ps1 | 18 ++-- tests/Get-DbaRandomizedDataset.Tests.ps1 | 12 +-- ...Get-DbaRandomizedDatasetTemplate.Tests.ps1 | 8 +- tests/Get-DbaRandomizedType.Tests.ps1 | 8 +- tests/Get-DbaRandomizedValue.Tests.ps1 | 26 ++--- tests/Get-DbaRegServerStore.Tests.ps1 | 6 +- tests/Get-DbaRegistryRoot.Tests.ps1 | 6 +- tests/Get-DbaReplArticle.Tests.ps1 | 14 +-- tests/Get-DbaReplArticleColumn.Tests.ps1 | 14 +-- tests/Get-DbaReplDistributor.Tests.ps1 | 30 +++--- tests/Get-DbaReplPublication.Tests.ps1 | 12 +-- tests/Get-DbaReplServer.Tests.ps1 | 30 +++--- tests/Get-DbaRgClassifierFunction.Tests.ps1 | 8 +- tests/Get-DbaRgWorkloadGroup.Tests.ps1 | 8 +- tests/Get-DbaRunningJob.Tests.ps1 | 32 +++--- tests/Get-DbaSchemaChangeHistory.Tests.ps1 | 14 +-- tests/Get-DbaServerRole.Tests.ps1 | 12 +-- tests/Get-DbaService.Tests.ps1 | 16 +-- tests/Get-DbaSpConfigure.Tests.ps1 | 10 +- tests/Get-DbaSpinLockStatistic.Tests.ps1 | 30 +++--- tests/Get-DbaSpn.Tests.ps1 | 32 +++--- tests/Get-DbaStartupParameter.Tests.ps1 | 32 +++--- tests/Get-DbaTempdbUsage.Tests.ps1 | 30 +++--- tests/Get-DbaTopResourceUsage.Tests.ps1 | 16 +-- tests/Get-DbaTraceFlag.Tests.ps1 | 8 +- tests/Get-DbaWaitStatistic.Tests.ps1 | 10 +- tests/Get-DbaWsfcAvailableDisk.Tests.ps1 | 30 +++--- tests/Get-DbaWsfcDisk.Tests.ps1 | 30 +++--- tests/Get-DbaWsfcNode.Tests.ps1 | 30 +++--- tests/Get-DbaWsfcResource.Tests.ps1 | 30 +++--- tests/Get-DbaWsfcResourceGroup.Tests.ps1 | 32 +++--- tests/Get-DbaWsfcResourceType.Tests.ps1 | 30 +++--- tests/Get-DbaXESession.Tests.ps1 | 8 +- tests/Get-DbaXESessionTarget.Tests.ps1 | 12 +-- tests/Get-DbaXESessionTemplate.Tests.ps1 | 8 +- tests/Get-DbaXESmartTarget.Tests.ps1 | 26 ++--- tests/Get-DbaXEStore.Tests.ps1 | 30 +++--- tests/Get-DbatoolsConfig.Tests.ps1 | 8 +- tests/Get-DbatoolsLog.Tests.ps1 | 22 ++-- tests/Get-DirectoryRestoreFile.Tests.ps1 | 6 +- tests/Get-ObjectNameParts.Tests.ps1 | 2 +- tests/Get-SqlDefaultSpConfigure.Tests.ps1 | 26 ++--- tests/Get-XpDirTreeRestoreFile.Tests.ps1 | 10 +- tests/Import-DbaCsv.Tests.ps1 | 40 +++---- tests/Import-DbaRegServer.Tests.ps1 | 12 +-- tests/Import-DbatoolsConfig.Tests.ps1 | 16 +-- tests/Install-DbaInstance.Tests.ps1 | 70 ++++++------ tests/Invoke-DbaAdvancedInstall.Tests.ps1 | 32 +++--- tests/Invoke-DbaAdvancedUpdate.Tests.ps1 | 18 ++-- tests/Invoke-DbaAgFailover.Tests.ps1 | 40 +++---- tests/Invoke-DbaBalanceDataFiles.Tests.ps1 | 14 +-- tests/Invoke-DbaCycleErrorLog.Tests.ps1 | 34 +++--- tests/Invoke-DbaDbClone.Tests.ps1 | 18 ++-- tests/Invoke-DbaDbDataGenerator.Tests.ps1 | 28 ++--- .../Invoke-DbaDbDbccCheckConstraint.Tests.ps1 | 16 +-- tests/Invoke-DbaDbDbccCleanTable.Tests.ps1 | 14 +-- tests/Invoke-DbaDbDecryptObject.Tests.ps1 | 14 +-- tests/Invoke-DbaDbMirrorFailover.Tests.ps1 | 12 +-- tests/Invoke-DbaDbPiiScan.Tests.ps1 | 30 +++--- tests/Invoke-DbaDbShrink.Tests.ps1 | 26 ++--- tests/Invoke-DbaDbUpgrade.Tests.ps1 | 24 ++--- tests/Invoke-DbaPfRelog.Tests.ps1 | 34 +++--- tests/Invoke-DbaQuery.Tests.ps1 | 32 +++--- tests/Invoke-DbatoolsFormatter.Tests.ps1 | 4 +- tests/Invoke-DbatoolsRenameHelper.Tests.ps1 | 6 +- tests/Join-DbaPath.Tests.ps1 | 30 +++--- tests/Measure-DbaBackupThroughput.Tests.ps1 | 18 ++-- tests/Measure-DbaDbVirtualLogFile.Tests.ps1 | 12 +-- tests/New-DbaAgentAlert.Tests.ps1 | 38 +++---- tests/New-DbaAgentAlertCategory.Tests.ps1 | 10 +- tests/New-DbaAgentJob.Tests.ps1 | 38 +++---- tests/New-DbaAgentSchedule.Tests.ps1 | 36 +++---- tests/New-DbaAzAccessToken.Tests.ps1 | 16 +-- tests/New-DbaComputerCertificate.Tests.ps1 | 34 +++--- ...omputerCertificateSigningRequest.Tests.ps1 | 16 +-- tests/New-DbaConnectionString.Tests.ps1 | 52 ++++----- .../New-DbaConnectionStringBuilder.Tests.ps1 | 26 ++--- tests/New-DbaCustomError.Tests.ps1 | 16 +-- tests/New-DbaDacOption.Tests.ps1 | 10 +- tests/New-DbaDatabase.Tests.ps1 | 46 ++++---- tests/New-DbaDbDataGeneratorConfig.Tests.ps1 | 20 ++-- tests/New-DbaDbEncryptionKey.Tests.ps1 | 18 ++-- tests/New-DbaDbFileGroup.Tests.ps1 | 14 +-- tests/New-DbaDbMailAccount.Tests.ps1 | 20 ++-- tests/New-DbaDbMailProfile.Tests.ps1 | 14 +-- tests/New-DbaDbMaskingConfig.Tests.ps1 | 32 +++--- tests/New-DbaDbUser.Tests.ps1 | 24 ++--- tests/New-DbaDirectory.Tests.ps1 | 36 +++---- tests/New-DbaFirewallRule.Tests.ps1 | 12 +-- tests/New-DbaLinkedServerLogin.Tests.ps1 | 18 ++-- tests/New-DbaLogin.Tests.ps1 | 44 ++++---- ...New-DbaReplCreationScriptOptions.Tests.ps1 | 4 +- tests/New-DbaRgResourcePool.Tests.ps1 | 30 +++--- tests/New-DbaSqlParameter.Tests.ps1 | 40 +++---- tests/New-DbaXESession.Tests.ps1 | 36 +++---- tests/New-DbaXESmartCsvWriter.Tests.ps1 | 12 +-- tests/New-DbaXESmartReplay.Tests.ps1 | 18 ++-- tests/New-DbaXESmartTableWriter.Tests.ps1 | 20 ++-- tests/New-DbatoolsSupportPackage.Tests.ps1 | 36 +++---- tests/Read-DbaAuditFile.Tests.ps1 | 6 +- tests/Read-DbaXEFile.Tests.ps1 | 6 +- tests/Remove-DbaAgDatabase.Tests.ps1 | 12 +-- tests/Remove-DbaAgentAlert.Tests.ps1 | 12 +-- tests/Remove-DbaAgentAlertCategory.Tests.ps1 | 10 +- tests/Remove-DbaAgentJob.Tests.ps1 | 14 +-- tests/Remove-DbaAgentJobCategory.Tests.ps1 | 12 +-- tests/Remove-DbaAgentSchedule.Tests.ps1 | 16 +-- tests/Remove-DbaCmConnection.Tests.ps1 | 32 +++--- tests/Remove-DbaDatabase.Tests.ps1 | 10 +- tests/Remove-DbaDatabaseSafely.Tests.ps1 | 28 ++--- tests/Remove-DbaDbCertificate.Tests.ps1 | 12 +-- tests/Remove-DbaDbCheckConstraint.Tests.ps1 | 14 +-- tests/Remove-DbaDbFileGroup.Tests.ps1 | 12 +-- tests/Remove-DbaDbLogShipping.Tests.ps1 | 14 +-- tests/Remove-DbaDbMailAccount.Tests.ps1 | 12 +-- tests/Remove-DbaDbMasterKey.Tests.ps1 | 42 ++++---- tests/Remove-DbaDbMirror.Tests.ps1 | 14 +-- tests/Remove-DbaDbPartitionFunction.Tests.ps1 | 12 +-- tests/Remove-DbaDbPartitionScheme.Tests.ps1 | 40 +++---- tests/Remove-DbaDbRole.Tests.ps1 | 18 ++-- tests/Remove-DbaDbSchema.Tests.ps1 | 12 +-- tests/Remove-DbaDbSequence.Tests.ps1 | 14 +-- tests/Remove-DbaDbSnapshot.Tests.ps1 | 18 ++-- tests/Remove-DbaDbTable.Tests.ps1 | 12 +-- tests/Remove-DbaDbTableData.Tests.ps1 | 24 ++--- tests/Remove-DbaDbUdf.Tests.ps1 | 22 ++-- tests/Remove-DbaDbUser.Tests.ps1 | 16 +-- tests/Remove-DbaDbView.Tests.ps1 | 12 +-- tests/Remove-DbaLinkedServerLogin.Tests.ps1 | 12 +-- tests/Remove-DbaLogin.Tests.ps1 | 12 +-- tests/Remove-DbaNetworkCertificate.Tests.ps1 | 34 +++--- tests/Remove-DbaRgResourcePool.Tests.ps1 | 14 +-- tests/Remove-DbaRgWorkloadGroup.Tests.ps1 | 16 +-- tests/Remove-DbaServerRole.Tests.ps1 | 10 +- tests/Remove-DbaXESmartTarget.Tests.ps1 | 32 +++--- tests/Repair-DbaDbMirror.Tests.ps1 | 42 ++++---- tests/Reset-DbatoolsConfig.Tests.ps1 | 38 +++---- tests/Resolve-DbaPath.Tests.ps1 | 32 +++--- tests/Restart-DbaService.Tests.ps1 | 18 ++-- tests/Restore-DbaDatabase.Tests.ps1 | 102 +++++++++--------- tests/Resume-DbaAgDbDataMovement.Tests.ps1 | 12 +-- tests/Save-DbaCommunitySoftware.Tests.ps1 | 12 +-- tests/Save-DbaDiagnosticQueryScript.Tests.ps1 | 28 ++--- tests/Save-DbaKbUpdate.Tests.ps1 | 14 +-- tests/Select-DbaBackupInformation.Tests.ps1 | 18 ++-- tests/Set-DbaAgentJobCategory.Tests.ps1 | 12 +-- tests/Set-DbaAgentSchedule.Tests.ps1 | 38 +++---- tests/Set-DbaAgentServer.Tests.ps1 | 48 ++++----- tests/Set-DbaCmConnection.Tests.ps1 | 42 ++++---- tests/Set-DbaDbFileGroup.Tests.ps1 | 18 ++-- 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-DbaDefaultPath.Tests.ps1 | 10 +- tests/Set-DbaLogin.Tests.ps1 | 38 +++---- tests/Set-DbaMaxDop.Tests.ps1 | 16 +-- tests/Set-DbaMaxMemory.Tests.ps1 | 10 +- tests/Set-DbaNetworkConfiguration.Tests.ps1 | 20 ++-- tests/Set-DbaRgResourcePool.Tests.ps1 | 30 +++--- tests/Set-DbaRgWorkloadGroup.Tests.ps1 | 28 ++--- tests/Set-DbatoolsConfig.Tests.ps1 | 38 +++---- .../Set-DbatoolsInsecureConnection.Tests.ps1 | 30 +++--- tests/Set-DbatoolsPath.Tests.ps1 | 32 +++--- tests/Start-DbaPfDataCollectorSet.Tests.ps1 | 12 +-- tests/Start-DbaService.Tests.ps1 | 16 +-- tests/Start-DbaXESmartTarget.Tests.ps1 | 18 ++-- tests/Stop-DbaDbEncryption.Tests.ps1 | 6 +- tests/Stop-DbaExternalProcess.Tests.ps1 | 8 +- tests/Stop-DbaService.Tests.ps1 | 18 ++-- tests/Stop-DbaTrace.Tests.ps1 | 10 +- tests/Stop-DbaXESession.Tests.ps1 | 12 +-- tests/Stop-DbaXESmartTarget.Tests.ps1 | 32 +++--- tests/Stop-Function.Tests.ps1 | 28 ++--- tests/Test-DbaAgSpn.Tests.ps1 | 38 +++---- tests/Test-DbaAgentJobOwner.Tests.ps1 | 12 +-- tests/Test-DbaBuild.Tests.ps1 | 18 ++-- ...DbaComputerCertificateExpiration.Tests.ps1 | 18 ++-- tests/Test-DbaConnection.Tests.ps1 | 10 +- tests/Test-DbaDbCompression.Tests.ps1 | 20 ++-- tests/Test-DbaDbDataGeneratorConfig.Tests.ps1 | 4 +- tests/Test-DbaDbOwner.Tests.ps1 | 14 +-- tests/Test-DbaDiskAlignment.Tests.ps1 | 10 +- tests/Test-DbaDiskAllocation.Tests.ps1 | 10 +- tests/Test-DbaDiskSpeed.Tests.ps1 | 12 +-- tests/Test-DbaIdentityUsage.Tests.ps1 | 14 +-- tests/Test-DbaLastBackup.Tests.ps1 | 54 +++++----- .../Test-DbaLinkedServerConnection.Tests.ps1 | 6 +- tests/Test-DbaLsnChain.Tests.ps1 | 6 +- tests/Test-DbaManagementObject.Tests.ps1 | 8 +- tests/Test-DbaMaxDop.Tests.ps1 | 6 +- tests/Test-DbaSpn.Tests.ps1 | 6 +- tests/Test-DbaTempDbConfig.Tests.ps1 | 6 +- tests/Test-DbaWindowsLogin.Tests.ps1 | 16 +-- tests/Test-PSRemoting.Tests.ps1 | 6 +- tests/Unregister-DbatoolsConfig.Tests.ps1 | 10 +- tests/Update-DbaServiceAccount.Tests.ps1 | 20 ++-- 330 files changed, 3250 insertions(+), 3250 deletions(-) diff --git a/tests/Add-DbaAgDatabase.Tests.ps1 b/tests/Add-DbaAgDatabase.Tests.ps1 index 146c6d1065..d4486a63cf 100644 --- a/tests/Add-DbaAgDatabase.Tests.ps1 +++ b/tests/Add-DbaAgDatabase.Tests.ps1 @@ -12,40 +12,40 @@ Describe "Add-DbaAgDatabase" { $CommandUnderTest = Get-Command Add-DbaAgDatabase } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have AvailabilityGroup as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have Secondary as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter Secondary -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Secondary -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SecondarySqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SecondarySqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SecondarySqlCredential -Type PSCredential -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have SeedingMode as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter SeedingMode -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SeedingMode -Type String -Mandatory:$false } It "Should have SharedPath as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter SharedPath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SharedPath -Type String -Mandatory:$false } It "Should have UseLastBackup as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter UseLastBackup -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter UseLastBackup -Type Switch -Mandatory:$false } It "Should have AdvancedBackupParams as a non-mandatory parameter of type Hashtable" { - $CommandUnderTest | Should -HaveParameter AdvancedBackupParams -Type Hashtable -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AdvancedBackupParams -Type Hashtable -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Add-DbaAgListener.Tests.ps1 b/tests/Add-DbaAgListener.Tests.ps1 index 6b01467773..566a112b25 100644 --- a/tests/Add-DbaAgListener.Tests.ps1 +++ b/tests/Add-DbaAgListener.Tests.ps1 @@ -12,40 +12,40 @@ Describe "Add-DbaAgListener" { $CommandUnderTest = Get-Command Add-DbaAgListener } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have AvailabilityGroup as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String[] -Mandatory:$false } It "Should have Name as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Name -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String -Mandatory:$false } It "Should have IPAddress as a non-mandatory parameter of type IPAddress[]" { - $CommandUnderTest | Should -HaveParameter IPAddress -Type IPAddress[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IPAddress -Type IPAddress[] -Mandatory:$false } It "Should have SubnetIP as a non-mandatory parameter of type IPAddress[]" { - $CommandUnderTest | Should -HaveParameter SubnetIP -Type IPAddress[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SubnetIP -Type IPAddress[] -Mandatory:$false } It "Should have SubnetMask as a non-mandatory parameter of type IPAddress[]" { - $CommandUnderTest | Should -HaveParameter SubnetMask -Type IPAddress[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SubnetMask -Type IPAddress[] -Mandatory:$false } It "Should have Port as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter Port -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Port -Type Int32 -Mandatory:$false } It "Should have Dhcp as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Dhcp -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Dhcp -Type Switch -Mandatory:$false } It "Should have Passthru as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Passthru -Type Switch -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type AvailabilityGroup[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type AvailabilityGroup[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type AvailabilityGroup[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Add-DbaExtendedProperty.Tests.ps1 b/tests/Add-DbaExtendedProperty.Tests.ps1 index 281778cee0..8668f27c99 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String -Mandatory:$false } It "Should have Value as a parameter" { - $CommandUnderTest | Should -HaveParameter Value -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Value -Type String -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Add-DbaPfDataCollectorCounter.Tests.ps1 b/tests/Add-DbaPfDataCollectorCounter.Tests.ps1 index 9a329ffa83..552666485b 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 DbaInstanceParameter[] parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have CollectorSet as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter CollectorSet -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CollectorSet -Type String[] -Mandatory:$false } It "Should have Collector as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Collector -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Collector -Type String[] -Mandatory:$false } It "Should have Counter as a non-mandatory Object[] parameter" { - $CommandUnderTest | Should -HaveParameter Counter -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Counter -Type Object[] -Mandatory:$false } It "Should have InputObject as a non-mandatory Object[] parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Add-DbaRegServer.Tests.ps1 b/tests/Add-DbaRegServer.Tests.ps1 index 6def95f445..8163ca9943 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have ServerName as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ServerName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ServerName -Type String -Mandatory:$false } It "Should have Name as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Name -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String -Mandatory:$false } It "Should have Description as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Description -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Description -Type String -Mandatory:$false } It "Should have Group as a non-mandatory parameter of type Object" { - $CommandUnderTest | Should -HaveParameter Group -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Group -Type Object -Mandatory:$false } It "Should have ActiveDirectoryTenant as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ActiveDirectoryTenant -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ActiveDirectoryTenant -Type String -Mandatory:$false } It "Should have ActiveDirectoryUserId as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ActiveDirectoryUserId -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ActiveDirectoryUserId -Type String -Mandatory:$false } It "Should have ConnectionString as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ConnectionString -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ConnectionString -Type String -Mandatory:$false } It "Should have OtherParams as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OtherParams -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OtherParams -Type String -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type ServerGroup[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type ServerGroup[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type ServerGroup[] -Mandatory:$false } It "Should have ServerObject as a non-mandatory parameter of type Server[]" { - $CommandUnderTest | Should -HaveParameter ServerObject -Type Server[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ServerObject -Type Server[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Backup-DbaComputerCertificate.Tests.ps1 b/tests/Backup-DbaComputerCertificate.Tests.ps1 index 08cf432673..0f64a8f620 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 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SecurePassword -Type SecureString -Mandatory:$false } It "Should have InputObject as a non-mandatory Object[] parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have Path as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have FilePath as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilePath -Type String -Mandatory:$false } It "Should have Type as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Backup-DbaDatabase.Tests.ps1 b/tests/Backup-DbaDatabase.Tests.ps1 index 138c6986a7..4d10e336ef 100644 --- a/tests/Backup-DbaDatabase.Tests.ps1 +++ b/tests/Backup-DbaDatabase.Tests.ps1 @@ -13,27 +13,27 @@ Describe "Backup-DbaDatabase Unit Tests" -Tag 'UnitTests' { } It "Should have SqlInstance parameter" { - $command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter -Not -Mandatory + $command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter -Mandatory:$false } It "Should have SqlCredential parameter" { - $command | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $command | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $command | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $command | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $command | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have Path parameter" { - $command | Should -HaveParameter Path -Type String[] -Not -Mandatory + $command | Should -HaveParameter Path -Type String[] -Mandatory:$false } It "Should have FilePath parameter" { - $command | Should -HaveParameter FilePath -Type String -Not -Mandatory + $command | Should -HaveParameter FilePath -Type String -Mandatory:$false } It "Should have IncrementPrefix parameter" { @@ -53,11 +53,11 @@ Describe "Backup-DbaDatabase Unit Tests" -Tag 'UnitTests' { } It "Should have Type parameter" { - $command | Should -HaveParameter Type -Type String -Not -Mandatory + $command | Should -HaveParameter Type -Type String -Mandatory:$false } It "Should have InputObject parameter" { - $command | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $command | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have CreateFolder parameter" { @@ -65,7 +65,7 @@ Describe "Backup-DbaDatabase Unit Tests" -Tag 'UnitTests' { } It "Should have FileCount parameter" { - $command | Should -HaveParameter FileCount -Type Int32 -Not -Mandatory + $command | Should -HaveParameter FileCount -Type Int32 -Mandatory:$false } It "Should have CompressBackup parameter" { @@ -81,23 +81,23 @@ Describe "Backup-DbaDatabase Unit Tests" -Tag 'UnitTests' { } It "Should have MaxTransferSize parameter" { - $command | Should -HaveParameter MaxTransferSize -Type Int32 -Not -Mandatory + $command | Should -HaveParameter MaxTransferSize -Type Int32 -Mandatory:$false } It "Should have BlockSize parameter" { - $command | Should -HaveParameter BlockSize -Type Int32 -Not -Mandatory + $command | Should -HaveParameter BlockSize -Type Int32 -Mandatory:$false } It "Should have BufferCount parameter" { - $command | Should -HaveParameter BufferCount -Type Int32 -Not -Mandatory + $command | Should -HaveParameter BufferCount -Type Int32 -Mandatory:$false } It "Should have AzureBaseUrl parameter" { - $command | Should -HaveParameter AzureBaseUrl -Type String[] -Not -Mandatory + $command | Should -HaveParameter AzureBaseUrl -Type String[] -Mandatory:$false } It "Should have AzureCredential parameter" { - $command | Should -HaveParameter AzureCredential -Type String -Not -Mandatory + $command | Should -HaveParameter AzureCredential -Type String -Mandatory:$false } It "Should have NoRecovery parameter" { @@ -121,7 +121,7 @@ Describe "Backup-DbaDatabase Unit Tests" -Tag 'UnitTests' { } It "Should have TimeStampFormat parameter" { - $command | Should -HaveParameter TimeStampFormat -Type String -Not -Mandatory + $command | Should -HaveParameter TimeStampFormat -Type String -Mandatory:$false } It "Should have IgnoreFileChecks parameter" { @@ -133,15 +133,15 @@ Describe "Backup-DbaDatabase Unit Tests" -Tag 'UnitTests' { } It "Should have EncryptionAlgorithm parameter" { - $command | Should -HaveParameter EncryptionAlgorithm -Type String -Not -Mandatory + $command | Should -HaveParameter EncryptionAlgorithm -Type String -Mandatory:$false } It "Should have EncryptionCertificate parameter" { - $command | Should -HaveParameter EncryptionCertificate -Type String -Not -Mandatory + $command | Should -HaveParameter EncryptionCertificate -Type String -Mandatory:$false } It "Should have Description parameter" { - $command | Should -HaveParameter Description -Type String -Not -Mandatory + $command | Should -HaveParameter Description -Type String -Mandatory:$false } It "Should have EnableException parameter" { diff --git a/tests/Backup-DbaDbMasterKey.Tests.ps1 b/tests/Backup-DbaDbMasterKey.Tests.ps1 index 3ce9df8f29..2fa3daac7f 100644 --- a/tests/Backup-DbaDbMasterKey.Tests.ps1 +++ b/tests/Backup-DbaDbMasterKey.Tests.ps1 @@ -6,31 +6,31 @@ Describe "Backup-DbaDbMasterKey" { $CommandUnderTest = Get-Command Backup-DbaDbMasterKey } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have SecurePassword as a non-mandatory parameter of type SecureString" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type SecureString -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SecurePassword -Type SecureString -Mandatory:$false } It "Should have Path as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Backup-DbaServiceMasterKey.Tests.ps1 b/tests/Backup-DbaServiceMasterKey.Tests.ps1 index b271931716..50a707bf2b 100644 --- a/tests/Backup-DbaServiceMasterKey.Tests.ps1 +++ b/tests/Backup-DbaServiceMasterKey.Tests.ps1 @@ -10,64 +10,64 @@ Describe "Backup-DbaServiceMasterKey" { $CommandUnderTest = Get-Command Backup-DbaServiceMasterKey } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have KeyCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter KeyCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter KeyCredential -Type PSCredential -Mandatory:$false } It "Should have SecurePassword as a non-mandatory parameter of type SecureString" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type SecureString -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SecurePassword -Type SecureString -Mandatory:$false } It "Should have Path as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } It "Should have WhatIf as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Should have Confirm as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } diff --git a/tests/Clear-DbaConnectionPool.Tests.ps1 b/tests/Clear-DbaConnectionPool.Tests.ps1 index 374889532c..ec07da95fb 100644 --- a/tests/Clear-DbaConnectionPool.Tests.ps1 +++ b/tests/Clear-DbaConnectionPool.Tests.ps1 @@ -12,49 +12,49 @@ Describe "Clear-DbaConnectionPool" { $CommandUnderTest = Get-Command Clear-DbaConnectionPool } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Clear-DbaLatchStatistics.Tests.ps1 b/tests/Clear-DbaLatchStatistics.Tests.ps1 index 2083bfd6ee..c842e23d2c 100644 --- a/tests/Clear-DbaLatchStatistics.Tests.ps1 +++ b/tests/Clear-DbaLatchStatistics.Tests.ps1 @@ -6,55 +6,55 @@ Describe "Clear-DbaLatchStatistics" { $CommandUnderTest = Get-Command Clear-DbaLatchStatistics } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } diff --git a/tests/Clear-DbaPlanCache.Tests.ps1 b/tests/Clear-DbaPlanCache.Tests.ps1 index bd1e7347d6..be8569ab00 100644 --- a/tests/Clear-DbaPlanCache.Tests.ps1 +++ b/tests/Clear-DbaPlanCache.Tests.ps1 @@ -10,19 +10,19 @@ Describe "Clear-DbaPlanCache" { $CommandUnderTest = Get-Command Clear-DbaPlanCache } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Threshold as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter Threshold -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Threshold -Type Int32 -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Connect-DbaInstance.Tests.ps1 b/tests/Connect-DbaInstance.Tests.ps1 index 3f5900dc2e..dd58ad377a 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String -Mandatory:$false } It "Should have ApplicationIntent as a parameter" { - $CommandUnderTest | Should -HaveParameter ApplicationIntent -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ApplicationIntent -Type String -Mandatory:$false } It "Should have AzureUnsupported as a parameter" { - $CommandUnderTest | Should -HaveParameter AzureUnsupported -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AzureUnsupported -Type Switch -Mandatory:$false } It "Should have BatchSeparator as a parameter" { - $CommandUnderTest | Should -HaveParameter BatchSeparator -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter BatchSeparator -Type String -Mandatory:$false } It "Should have ClientName as a parameter" { - $CommandUnderTest | Should -HaveParameter ClientName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ClientName -Type String -Mandatory:$false } It "Should have ConnectTimeout as a parameter" { - $CommandUnderTest | Should -HaveParameter ConnectTimeout -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ConnectTimeout -Type Int32 -Mandatory:$false } It "Should have EncryptConnection as a parameter" { - $CommandUnderTest | Should -HaveParameter EncryptConnection -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EncryptConnection -Type Switch -Mandatory:$false } It "Should have FailoverPartner as a parameter" { - $CommandUnderTest | Should -HaveParameter FailoverPartner -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FailoverPartner -Type String -Mandatory:$false } It "Should have LockTimeout as a parameter" { - $CommandUnderTest | Should -HaveParameter LockTimeout -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LockTimeout -Type Int32 -Mandatory:$false } It "Should have MaxPoolSize as a parameter" { - $CommandUnderTest | Should -HaveParameter MaxPoolSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaxPoolSize -Type Int32 -Mandatory:$false } It "Should have MinPoolSize as a parameter" { - $CommandUnderTest | Should -HaveParameter MinPoolSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MinPoolSize -Type Int32 -Mandatory:$false } It "Should have MinimumVersion as a parameter" { - $CommandUnderTest | Should -HaveParameter MinimumVersion -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MinimumVersion -Type Int32 -Mandatory:$false } It "Should have MultipleActiveResultSets as a parameter" { - $CommandUnderTest | Should -HaveParameter MultipleActiveResultSets -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MultipleActiveResultSets -Type Switch -Mandatory:$false } It "Should have MultiSubnetFailover as a parameter" { - $CommandUnderTest | Should -HaveParameter MultiSubnetFailover -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MultiSubnetFailover -Type Switch -Mandatory:$false } It "Should have NetworkProtocol as a parameter" { - $CommandUnderTest | Should -HaveParameter NetworkProtocol -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NetworkProtocol -Type String -Mandatory:$false } It "Should have NonPooledConnection as a parameter" { - $CommandUnderTest | Should -HaveParameter NonPooledConnection -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NonPooledConnection -Type Switch -Mandatory:$false } It "Should have PacketSize as a parameter" { - $CommandUnderTest | Should -HaveParameter PacketSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PacketSize -Type Int32 -Mandatory:$false } It "Should have PooledConnectionLifetime as a parameter" { - $CommandUnderTest | Should -HaveParameter PooledConnectionLifetime -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PooledConnectionLifetime -Type Int32 -Mandatory:$false } It "Should have SqlExecutionModes as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlExecutionModes -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlExecutionModes -Type String -Mandatory:$false } It "Should have StatementTimeout as a parameter" { - $CommandUnderTest | Should -HaveParameter StatementTimeout -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter StatementTimeout -Type Int32 -Mandatory:$false } It "Should have TrustServerCertificate as a parameter" { - $CommandUnderTest | Should -HaveParameter TrustServerCertificate -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter TrustServerCertificate -Type Switch -Mandatory:$false } It "Should have WorkstationId as a parameter" { - $CommandUnderTest | Should -HaveParameter WorkstationId -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WorkstationId -Type String -Mandatory:$false } It "Should have AlwaysEncrypted as a parameter" { - $CommandUnderTest | Should -HaveParameter AlwaysEncrypted -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AlwaysEncrypted -Type Switch -Mandatory:$false } It "Should have AppendConnectionString as a parameter" { - $CommandUnderTest | Should -HaveParameter AppendConnectionString -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AppendConnectionString -Type String -Mandatory:$false } It "Should have SqlConnectionOnly as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlConnectionOnly -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlConnectionOnly -Type Switch -Mandatory:$false } It "Should have AzureDomain as a parameter" { - $CommandUnderTest | Should -HaveParameter AzureDomain -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AzureDomain -Type String -Mandatory:$false } It "Should have Tenant as a parameter" { - $CommandUnderTest | Should -HaveParameter Tenant -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Tenant -Type String -Mandatory:$false } It "Should have AccessToken as a parameter" { - $CommandUnderTest | Should -HaveParameter AccessToken -Type PSObject -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AccessToken -Type PSObject -Mandatory:$false } It "Should have DedicatedAdminConnection as a parameter" { - $CommandUnderTest | Should -HaveParameter DedicatedAdminConnection -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DedicatedAdminConnection -Type Switch -Mandatory:$false } It "Should have DisableException as a parameter" { - $CommandUnderTest | Should -HaveParameter DisableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DisableException -Type Switch -Mandatory:$false } } diff --git a/tests/ConvertTo-DbaDataTable.Tests.ps1 b/tests/ConvertTo-DbaDataTable.Tests.ps1 index b37b35205c..0e76a4a37b 100644 --- a/tests/ConvertTo-DbaDataTable.Tests.ps1 +++ b/tests/ConvertTo-DbaDataTable.Tests.ps1 @@ -10,13 +10,13 @@ Describe "ConvertTo-DbaDataTable" { $CommandUnderTest = Get-Command ConvertTo-DbaDataTable } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject[] -Mandatory:$false } It "Should have TimeSpanType as a parameter" { - $CommandUnderTest | Should -HaveParameter TimeSpanType -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter TimeSpanType -Type String -Mandatory:$false } It "Should have SizeType as a parameter" { - $CommandUnderTest | Should -HaveParameter SizeType -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SizeType -Type String -Mandatory:$false } It "Should have IgnoreNull as a switch parameter" { $CommandUnderTest | Should -HaveParameter IgnoreNull -Type Switch diff --git a/tests/ConvertTo-DbaTimeline.Tests.ps1 b/tests/ConvertTo-DbaTimeline.Tests.ps1 index 5dcebcad17..d6013692fd 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 Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have ExcludeRowLabel as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeRowLabel -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeRowLabel -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Copy-DbaDbAssembly.Tests.ps1 b/tests/Copy-DbaDbAssembly.Tests.ps1 index bcc42baf63..e618eb8057 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 DbaInstanceParameter -Not -Mandatory + $Command | Should -HaveParameter Source -Type DbaInstanceParameter -Mandatory:$false } It "Should have SourceSqlCredential parameter" { - $Command | Should -HaveParameter SourceSqlCredential -Type PSCredential -Not -Mandatory + $Command | Should -HaveParameter SourceSqlCredential -Type PSCredential -Mandatory:$false } It "Should have Destination parameter" { - $Command | Should -HaveParameter Destination -Type DbaInstanceParameter[] -Not -Mandatory + $Command | Should -HaveParameter Destination -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have DestinationSqlCredential parameter" { - $Command | Should -HaveParameter DestinationSqlCredential -Type PSCredential -Not -Mandatory + $Command | Should -HaveParameter DestinationSqlCredential -Type PSCredential -Mandatory:$false } It "Should have Assembly parameter" { - $Command | Should -HaveParameter Assembly -Type Object[] -Not -Mandatory + $Command | Should -HaveParameter Assembly -Type Object[] -Mandatory:$false } It "Should have ExcludeAssembly parameter" { - $Command | Should -HaveParameter ExcludeAssembly -Type Object[] -Not -Mandatory + $Command | Should -HaveParameter ExcludeAssembly -Type Object[] -Mandatory:$false } It "Should have Force parameter" { - $Command | Should -HaveParameter Force -Type Switch -Not -Mandatory + $Command | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $Command | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $Command | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Copy-DbaXESessionTemplate.Tests.ps1 b/tests/Copy-DbaXESessionTemplate.Tests.ps1 index 2472f8f9c0..a8802531c7 100644 --- a/tests/Copy-DbaXESessionTemplate.Tests.ps1 +++ b/tests/Copy-DbaXESessionTemplate.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Copy-DbaXESessionTemplate" { $CommandUnderTest = Get-Command Copy-DbaXESessionTemplate } It "Should have Path as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Path -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String[] -Mandatory:$false } It "Should have Destination as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Destination -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Destination -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Disable-DbaForceNetworkEncryption.Tests.ps1 b/tests/Disable-DbaForceNetworkEncryption.Tests.ps1 index a991e2ad0b..56fea903c4 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Disable-DbaReplDistributor.Tests.ps1 b/tests/Disable-DbaReplDistributor.Tests.ps1 index e514227791..d356cc5b43 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Disable-DbaReplPublishing.Tests.ps1 b/tests/Disable-DbaReplPublishing.Tests.ps1 index 57e8b8dd32..7e610c30c2 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Disable-DbaStartupProcedure.Tests.ps1 b/tests/Disable-DbaStartupProcedure.Tests.ps1 index c477f3f545..9ec9ec653d 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have StartupProcedure parameter" { - $CommandUnderTest | Should -HaveParameter StartupProcedure -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter StartupProcedure -Type String[] -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Disconnect-DbaInstance.Tests.ps1 b/tests/Disconnect-DbaInstance.Tests.ps1 index 4c659b12c8..4cc8957076 100644 --- a/tests/Disconnect-DbaInstance.Tests.ps1 +++ b/tests/Disconnect-DbaInstance.Tests.ps1 @@ -6,52 +6,52 @@ Describe "Disconnect-DbaInstance" { $CommandUnderTest = Get-Command Disconnect-DbaInstance } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } diff --git a/tests/Enable-DbaAgHadr.Tests.ps1 b/tests/Enable-DbaAgHadr.Tests.ps1 index deb5802992..776bd98019 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Enable-DbaDbEncryption.Tests.ps1 b/tests/Enable-DbaDbEncryption.Tests.ps1 index 085c129cf9..106607b326 100644 --- a/tests/Enable-DbaDbEncryption.Tests.ps1 +++ b/tests/Enable-DbaDbEncryption.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Enable-DbaDbEncryption" { $CommandUnderTest = Get-Command Enable-DbaDbEncryption } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have EncryptorName as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter EncryptorName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EncryptorName -Type String -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have Force as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Enable-DbaForceNetworkEncryption.Tests.ps1 b/tests/Enable-DbaForceNetworkEncryption.Tests.ps1 index f5232043e8..05e523915a 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Enable-DbaReplDistributor.Tests.ps1 b/tests/Enable-DbaReplDistributor.Tests.ps1 index 9215ca64e6..7bf56c6b19 100644 --- a/tests/Enable-DbaReplDistributor.Tests.ps1 +++ b/tests/Enable-DbaReplDistributor.Tests.ps1 @@ -11,58 +11,58 @@ Describe "Enable-DbaReplDistributor" { $CommandUnderTest = Get-Command Enable-DbaReplDistributor } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have DistributionDatabase as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter DistributionDatabase -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DistributionDatabase -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } It "Should have WhatIf as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Should have Confirm as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } } diff --git a/tests/Enable-DbaReplPublishing.Tests.ps1 b/tests/Enable-DbaReplPublishing.Tests.ps1 index 8487276e24..aa31f4cfe2 100644 --- a/tests/Enable-DbaReplPublishing.Tests.ps1 +++ b/tests/Enable-DbaReplPublishing.Tests.ps1 @@ -11,61 +11,61 @@ Describe "Enable-DbaReplPublishing" { $CommandUnderTest = Get-Command Enable-DbaReplPublishing } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have SnapshotShare as a parameter" { - $CommandUnderTest | Should -HaveParameter SnapshotShare -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SnapshotShare -Type String -Mandatory:$false } It "Should have PublisherSqlLogin as a parameter" { - $CommandUnderTest | Should -HaveParameter PublisherSqlLogin -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PublisherSqlLogin -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } } diff --git a/tests/Export-DbaBinaryFile.Tests.ps1 b/tests/Export-DbaBinaryFile.Tests.ps1 index eb3c5c4b61..f54d7b138c 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have Table as a parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Table -Type String[] -Mandatory:$false } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Mandatory:$false } It "Should have FileNameColumn as a parameter" { - $CommandUnderTest | Should -HaveParameter FileNameColumn -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FileNameColumn -Type String -Mandatory:$false } It "Should have BinaryColumn as a parameter" { - $CommandUnderTest | Should -HaveParameter BinaryColumn -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter BinaryColumn -Type String -Mandatory:$false } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have Query as a parameter" { - $CommandUnderTest | Should -HaveParameter Query -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Query -Type String -Mandatory:$false } It "Should have FilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilePath -Type String -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Table[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Table[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Export-DbaCredential.Tests.ps1 b/tests/Export-DbaCredential.Tests.ps1 index d509968891..b282f133d0 100644 --- a/tests/Export-DbaCredential.Tests.ps1 +++ b/tests/Export-DbaCredential.Tests.ps1 @@ -6,34 +6,34 @@ Describe "Export-DbaCredential Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Export-DbaCredential } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Identity as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Identity -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Identity -Type String[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have Path as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have FilePath as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter FilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilePath -Type String -Mandatory:$false } It "Should have ExcludePassword as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludePassword -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludePassword -Type Switch -Mandatory:$false } It "Should have Append as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Append -Type Switch -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Credential[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Credential[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Credential[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Export-DbaDacPackage.Tests.ps1 b/tests/Export-DbaDacPackage.Tests.ps1 index d8a28defe2..3f63fefda9 100644 --- a/tests/Export-DbaDacPackage.Tests.ps1 +++ b/tests/Export-DbaDacPackage.Tests.ps1 @@ -6,43 +6,43 @@ Describe "Export-DbaDacPackage" { $CommandUnderTest = Get-Command Export-DbaDacPackage } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have AllUserDatabases as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter AllUserDatabases -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AllUserDatabases -Type Switch -Mandatory:$false } It "Should have Path as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have FilePath as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter FilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilePath -Type String -Mandatory:$false } It "Should have DacOption as a non-mandatory parameter of type Object" { - $CommandUnderTest | Should -HaveParameter DacOption -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DacOption -Type Object -Mandatory:$false } It "Should have ExtendedParameters as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ExtendedParameters -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExtendedParameters -Type String -Mandatory:$false } It "Should have ExtendedProperties as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ExtendedProperties -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExtendedProperties -Type String -Mandatory:$false } It "Should have Type as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Type -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String -Mandatory:$false } It "Should have Table as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Table -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Table -Type String[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Export-DbaDbRole.Tests.ps1 b/tests/Export-DbaDbRole.Tests.ps1 index 27ff23be77..ed5012ec06 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have ScriptingOptionsObject parameter" { - $CommandUnderTest | Should -HaveParameter ScriptingOptionsObject -Type ScriptingOptions -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ScriptingOptionsObject -Type ScriptingOptions -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have Role parameter" { - $CommandUnderTest | Should -HaveParameter Role -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Role -Type Object[] -Mandatory:$false } It "Should have ExcludeRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeRole -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeRole -Type Object[] -Mandatory:$false } It "Should have ExcludeFixedRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeFixedRole -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeFixedRole -Type Switch -Mandatory:$false } It "Should have IncludeRoleMember parameter" { - $CommandUnderTest | Should -HaveParameter IncludeRoleMember -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeRoleMember -Type Switch -Mandatory:$false } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have FilePath parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilePath -Type String -Mandatory:$false } It "Should have Passthru parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Passthru -Type Switch -Mandatory:$false } It "Should have BatchSeparator parameter" { - $CommandUnderTest | Should -HaveParameter BatchSeparator -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter BatchSeparator -Type String -Mandatory:$false } It "Should have NoClobber parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoClobber -Type Switch -Mandatory:$false } It "Should have Append parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Append -Type Switch -Mandatory:$false } It "Should have NoPrefix parameter" { - $CommandUnderTest | Should -HaveParameter NoPrefix -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoPrefix -Type Switch -Mandatory:$false } It "Should have Encoding parameter" { - $CommandUnderTest | Should -HaveParameter Encoding -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Encoding -Type String -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Export-DbaDbTableData.Tests.ps1 b/tests/Export-DbaDbTableData.Tests.ps1 index 31b9178670..cc6ccb3f94 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 Table[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Table[] -Mandatory:$false } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have FilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilePath -Type String -Mandatory:$false } It "Should have Encoding as a parameter" { - $CommandUnderTest | Should -HaveParameter Encoding -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Encoding -Type String -Mandatory:$false } It "Should have BatchSeparator as a parameter" { - $CommandUnderTest | Should -HaveParameter BatchSeparator -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter BatchSeparator -Type String -Mandatory:$false } It "Should have NoPrefix as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoPrefix -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoPrefix -Type Switch -Mandatory:$false } It "Should have Passthru as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Passthru -Type Switch -Mandatory:$false } It "Should have NoClobber as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoClobber -Type Switch -Mandatory:$false } It "Should have Append as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Append -Type Switch -Mandatory:$false } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Export-DbaDiagnosticQuery.Tests.ps1 b/tests/Export-DbaDiagnosticQuery.Tests.ps1 index 4f90070440..69708a649d 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 Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have ConvertTo as a parameter" { - $CommandUnderTest | Should -HaveParameter ConvertTo -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ConvertTo -Type String -Mandatory:$false } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type FileInfo -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type FileInfo -Mandatory:$false } It "Should have Suffix as a parameter" { - $CommandUnderTest | Should -HaveParameter Suffix -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Suffix -Type String -Mandatory:$false } It "Should have NoPlanExport as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoPlanExport -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoPlanExport -Type Switch -Mandatory:$false } It "Should have NoQueryExport as a switch parameter" { - $CommandUnderTest | Should -HaveParameter NoQueryExport -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoQueryExport -Type Switch -Mandatory:$false } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Export-DbaInstance.Tests.ps1 b/tests/Export-DbaInstance.Tests.ps1 index 08f7d8cbf8..3b0c3f37c1 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have NoRecovery as a parameter" { - $CommandUnderTest | Should -HaveParameter NoRecovery -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoRecovery -Type Switch -Mandatory:$false } It "Should have AzureCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter AzureCredential -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AzureCredential -Type String -Mandatory:$false } It "Should have IncludeDbMasterKey as a parameter" { - $CommandUnderTest | Should -HaveParameter IncludeDbMasterKey -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeDbMasterKey -Type Switch -Mandatory:$false } It "Should have Exclude as a parameter" { - $CommandUnderTest | Should -HaveParameter Exclude -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Exclude -Type String[] -Mandatory:$false } It "Should have BatchSeparator as a parameter" { - $CommandUnderTest | Should -HaveParameter BatchSeparator -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter BatchSeparator -Type String -Mandatory:$false } It "Should have ScriptingOption as a parameter" { - $CommandUnderTest | Should -HaveParameter ScriptingOption -Type ScriptingOptions -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ScriptingOption -Type ScriptingOptions -Mandatory:$false } It "Should have NoPrefix as a parameter" { - $CommandUnderTest | Should -HaveParameter NoPrefix -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoPrefix -Type Switch -Mandatory:$false } It "Should have ExcludePassword as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludePassword -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludePassword -Type Switch -Mandatory:$false } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Export-DbaPfDataCollectorSetTemplate.Tests.ps1 b/tests/Export-DbaPfDataCollectorSetTemplate.Tests.ps1 index 37f6e2aef3..ac3740907f 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have CollectorSet as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter CollectorSet -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CollectorSet -Type String[] -Mandatory:$false } It "Should have Path as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have FilePath as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilePath -Type String -Mandatory:$false } It "Should have InputObject as a non-mandatory Object[] parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Export-DbaReplServerSetting.Tests.ps1 b/tests/Export-DbaReplServerSetting.Tests.ps1 index 78725eb25f..f09f1c0f86 100644 --- a/tests/Export-DbaReplServerSetting.Tests.ps1 +++ b/tests/Export-DbaReplServerSetting.Tests.ps1 @@ -14,37 +14,37 @@ Describe "Export-DbaReplServerSetting" { $CommandUnderTest = Get-Command Export-DbaReplServerSetting } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Path as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have FilePath as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter FilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilePath -Type String -Mandatory:$false } It "Should have ScriptOption as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter ScriptOption -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ScriptOption -Type Object[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have Encoding as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Encoding -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Encoding -Type String -Mandatory:$false } It "Should have Passthru as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Passthru -Type Switch -Mandatory:$false } It "Should have NoClobber as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoClobber -Type Switch -Mandatory:$false } It "Should have Append as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Append -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Export-DbaServerRole.Tests.ps1 b/tests/Export-DbaServerRole.Tests.ps1 index d58c788958..aa89f6aeb8 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have ScriptingOptionsObject parameter" { - $CommandUnderTest | Should -HaveParameter ScriptingOptionsObject -Type ScriptingOptions -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ScriptingOptionsObject -Type ScriptingOptions -Mandatory:$false } It "Should have ServerRole parameter" { - $CommandUnderTest | Should -HaveParameter ServerRole -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ServerRole -Type String[] -Mandatory:$false } It "Should have ExcludeServerRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeServerRole -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeServerRole -Type String[] -Mandatory:$false } It "Should have ExcludeFixedRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeFixedRole -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeFixedRole -Type Switch -Mandatory:$false } It "Should have IncludeRoleMember parameter" { - $CommandUnderTest | Should -HaveParameter IncludeRoleMember -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeRoleMember -Type Switch -Mandatory:$false } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have FilePath parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilePath -Type String -Mandatory:$false } It "Should have Passthru parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Passthru -Type Switch -Mandatory:$false } It "Should have BatchSeparator parameter" { - $CommandUnderTest | Should -HaveParameter BatchSeparator -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter BatchSeparator -Type String -Mandatory:$false } It "Should have NoClobber parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoClobber -Type Switch -Mandatory:$false } It "Should have Append parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Append -Type Switch -Mandatory:$false } It "Should have NoPrefix parameter" { - $CommandUnderTest | Should -HaveParameter NoPrefix -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoPrefix -Type Switch -Mandatory:$false } It "Should have Encoding parameter" { - $CommandUnderTest | Should -HaveParameter Encoding -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Encoding -Type String -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Export-DbaSpConfigure.Tests.ps1 b/tests/Export-DbaSpConfigure.Tests.ps1 index 5981d87fa6..e64842352a 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have FilePath parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilePath -Type String -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Export-DbaUser.Tests.ps1 b/tests/Export-DbaUser.Tests.ps1 index 4167566b79..2c7bc71d46 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have User parameter" { - $CommandUnderTest | Should -HaveParameter User -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter User -Type String[] -Mandatory:$false } It "Should have DestinationVersion parameter" { - $CommandUnderTest | Should -HaveParameter DestinationVersion -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DestinationVersion -Type String -Mandatory:$false } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have FilePath parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilePath -Type String -Mandatory:$false } It "Should have Encoding parameter" { - $CommandUnderTest | Should -HaveParameter Encoding -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Encoding -Type String -Mandatory:$false } It "Should have NoClobber parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoClobber -Type Switch -Mandatory:$false } It "Should have Append parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Append -Type Switch -Mandatory:$false } It "Should have Passthru parameter" { - $CommandUnderTest | Should -HaveParameter Passthru -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Passthru -Type Switch -Mandatory:$false } It "Should have Template parameter" { - $CommandUnderTest | Should -HaveParameter Template -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Template -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have ScriptingOptionsObject parameter" { - $CommandUnderTest | Should -HaveParameter ScriptingOptionsObject -Type ScriptingOptions -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ScriptingOptionsObject -Type ScriptingOptions -Mandatory:$false } It "Should have ExcludeGoBatchSeparator parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeGoBatchSeparator -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeGoBatchSeparator -Type Switch -Mandatory:$false } } } diff --git a/tests/Export-DbaXESessionTemplate.Tests.ps1 b/tests/Export-DbaXESessionTemplate.Tests.ps1 index 6a5dfc152a..efe47d7f59 100644 --- a/tests/Export-DbaXESessionTemplate.Tests.ps1 +++ b/tests/Export-DbaXESessionTemplate.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Export-DbaXESessionTemplate" { $CommandUnderTest = Get-Command Export-DbaXESessionTemplate } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Session as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Session -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Session -Type Object[] -Mandatory:$false } It "Should have Path as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have FilePath as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter FilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilePath -Type String -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Session[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Session[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Session[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Export-DbatoolsConfig.Tests.ps1 b/tests/Export-DbatoolsConfig.Tests.ps1 index 0245824974..cf031b0efa 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 String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FullName -Type String -Mandatory:$false } It "Should have Module as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Module -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Module -Type String -Mandatory:$false } It "Should have Name as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String -Mandatory:$false } It "Should have Config as a non-mandatory Config[] parameter" { - $CommandUnderTest | Should -HaveParameter Config -Type Config[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Config -Type Config[] -Mandatory:$false } It "Should have ModuleName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ModuleName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ModuleName -Type String -Mandatory:$false } It "Should have ModuleVersion as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter ModuleVersion -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ModuleVersion -Type Int32 -Mandatory:$false } It "Should have Scope as a non-mandatory ConfigScope parameter" { - $CommandUnderTest | Should -HaveParameter Scope -Type ConfigScope -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Scope -Type ConfigScope -Mandatory:$false } It "Should have OutPath as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter OutPath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutPath -Type String -Mandatory:$false } It "Should have SkipUnchanged as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter SkipUnchanged -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SkipUnchanged -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Find-DbaCommand.Tests.ps1 b/tests/Find-DbaCommand.Tests.ps1 index 6249712088..b9b50bcc79 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 String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Pattern -Type String -Mandatory:$false } It "Should have Tag as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Tag -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Tag -Type String[] -Mandatory:$false } It "Should have Author as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Author -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Author -Type String -Mandatory:$false } It "Should have MinimumVersion as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter MinimumVersion -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MinimumVersion -Type String -Mandatory:$false } It "Should have MaximumVersion as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter MaximumVersion -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaximumVersion -Type String -Mandatory:$false } It "Should have Rebuild as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Rebuild -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Rebuild -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Find-DbaDatabase.Tests.ps1 b/tests/Find-DbaDatabase.Tests.ps1 index f4ce566ff9..40cbc8a7e4 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Property as a parameter" { - $CommandUnderTest | Should -HaveParameter Property -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Property -Type String -Mandatory:$false } It "Should have Pattern as a parameter" { - $CommandUnderTest | Should -HaveParameter Pattern -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Pattern -Type String -Mandatory:$false } It "Should have Exact as a parameter" { - $CommandUnderTest | Should -HaveParameter Exact -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Exact -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Find-DbaDbDisabledIndex.Tests.ps1 b/tests/Find-DbaDbDisabledIndex.Tests.ps1 index 57b0c616b6..f47a88e0fe 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have NoClobber as a parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoClobber -Type Switch -Mandatory:$false } It "Should have Append as a parameter" { - $CommandUnderTest | Should -HaveParameter Append -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Append -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Find-DbaInstance.Tests.ps1 b/tests/Find-DbaInstance.Tests.ps1 index 9fc91c2f42..c2f72c04d4 100644 --- a/tests/Find-DbaInstance.Tests.ps1 +++ b/tests/Find-DbaInstance.Tests.ps1 @@ -6,34 +6,34 @@ Describe "Find-DbaInstance" { $CommandUnderTest = Get-Command Find-DbaInstance } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have DiscoveryType as a non-mandatory parameter of type DbaInstanceDiscoveryType" { - $CommandUnderTest | Should -HaveParameter DiscoveryType -Type DbaInstanceDiscoveryType -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DiscoveryType -Type DbaInstanceDiscoveryType -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have ScanType as a non-mandatory parameter of type DbaInstanceScanType[]" { - $CommandUnderTest | Should -HaveParameter ScanType -Type DbaInstanceScanType[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ScanType -Type DbaInstanceScanType[] -Mandatory:$false } It "Should have IpAddress as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter IpAddress -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IpAddress -Type String[] -Mandatory:$false } It "Should have DomainController as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter DomainController -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DomainController -Type String -Mandatory:$false } It "Should have TCPPort as a non-mandatory parameter of type Int32[]" { - $CommandUnderTest | Should -HaveParameter TCPPort -Type Int32[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter TCPPort -Type Int32[] -Mandatory:$false } It "Should have MinimumConfidence as a non-mandatory parameter of type DbaInstanceConfidenceLevel" { - $CommandUnderTest | Should -HaveParameter MinimumConfidence -Type DbaInstanceConfidenceLevel -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MinimumConfidence -Type DbaInstanceConfidenceLevel -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Find-DbaSimilarTable.Tests.ps1 b/tests/Find-DbaSimilarTable.Tests.ps1 index fe119ee903..be20d240c3 100644 --- a/tests/Find-DbaSimilarTable.Tests.ps1 +++ b/tests/Find-DbaSimilarTable.Tests.ps1 @@ -6,34 +6,34 @@ Describe "Find-DbaSimilarTable" { $CommandUnderTest = Get-Command Find-DbaSimilarTable } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have SchemaName as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter SchemaName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SchemaName -Type String -Mandatory:$false } It "Should have TableName as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter TableName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter TableName -Type String -Mandatory:$false } It "Should have ExcludeViews as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeViews -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeViews -Type Switch -Mandatory:$false } It "Should have IncludeSystemDatabases as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemDatabases -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeSystemDatabases -Type Switch -Mandatory:$false } It "Should have MatchPercentThreshold as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter MatchPercentThreshold -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MatchPercentThreshold -Type Int32 -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaAgBackupHistory.Tests.ps1 b/tests/Get-DbaAgBackupHistory.Tests.ps1 index b8fab304f5..502110967f 100644 --- a/tests/Get-DbaAgBackupHistory.Tests.ps1 +++ b/tests/Get-DbaAgBackupHistory.Tests.ps1 @@ -6,64 +6,64 @@ Describe "Get-DbaAgBackupHistory" { $CommandUnderTest = Get-Command Get-DbaAgBackupHistory } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have AvailabilityGroup as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have IncludeCopyOnly as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeCopyOnly -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeCopyOnly -Type Switch -Mandatory:$false } It "Should have Force as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have Since as a non-mandatory parameter of type DateTime" { - $CommandUnderTest | Should -HaveParameter Since -Type DateTime -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Since -Type DateTime -Mandatory:$false } It "Should have RecoveryFork as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter RecoveryFork -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RecoveryFork -Type String -Mandatory:$false } It "Should have Last as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Last -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Last -Type Switch -Mandatory:$false } It "Should have LastFull as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter LastFull -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LastFull -Type Switch -Mandatory:$false } It "Should have LastDiff as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter LastDiff -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LastDiff -Type Switch -Mandatory:$false } It "Should have LastLog as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter LastLog -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LastLog -Type Switch -Mandatory:$false } It "Should have DeviceType as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter DeviceType -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DeviceType -Type String[] -Mandatory:$false } It "Should have Raw as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Raw -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Raw -Type Switch -Mandatory:$false } It "Should have LastLsn as a non-mandatory parameter of type BigInteger" { - $CommandUnderTest | Should -HaveParameter LastLsn -Type BigInteger -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LastLsn -Type BigInteger -Mandatory:$false } It "Should have IncludeMirror as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeMirror -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeMirror -Type Switch -Mandatory:$false } It "Should have Type as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Type -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String[] -Mandatory:$false } It "Should have LsnSort as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter LsnSort -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LsnSort -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaAgDatabase.Tests.ps1 b/tests/Get-DbaAgDatabase.Tests.ps1 index 7d894c7d93..3508963ac2 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String[] -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type AvailabilityGroup[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type AvailabilityGroup[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaAgReplica.Tests.ps1 b/tests/Get-DbaAgReplica.Tests.ps1 index dac0644060..e0fa084bfb 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String[] -Mandatory:$false } It "Should have Replica as a parameter" { - $CommandUnderTest | Should -HaveParameter Replica -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Replica -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type AvailabilityGroup[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type AvailabilityGroup[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaAgentJob.Tests.ps1 b/tests/Get-DbaAgentJob.Tests.ps1 index 357c793287..0d239d48ae 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Job parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Job -Type String[] -Mandatory:$false } It "Should have ExcludeJob parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeJob -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeJob -Type String[] -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have Category parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Category -Type String[] -Mandatory:$false } It "Should have ExcludeCategory parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeCategory -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeCategory -Type String[] -Mandatory:$false } It "Should have ExcludeDisabledJobs parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDisabledJobs -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDisabledJobs -Type Switch -Mandatory:$false } It "Should have IncludeExecution parameter" { - $CommandUnderTest | Should -HaveParameter IncludeExecution -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeExecution -Type Switch -Mandatory:$false } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaAgentJobHistory.Tests.ps1 b/tests/Get-DbaAgentJobHistory.Tests.ps1 index 5ad1d327f1..e57960f29b 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[] -Not -Mandatory + $command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $command | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Job parameter" { - $command | Should -HaveParameter Job -Type Object[] -Not -Mandatory + $command | Should -HaveParameter Job -Type Object[] -Mandatory:$false } It "Should have ExcludeJob parameter" { - $command | Should -HaveParameter ExcludeJob -Type Object[] -Not -Mandatory + $command | Should -HaveParameter ExcludeJob -Type Object[] -Mandatory:$false } It "Should have StartDate parameter" { - $command | Should -HaveParameter StartDate -Type DateTime -Not -Mandatory + $command | Should -HaveParameter StartDate -Type DateTime -Mandatory:$false } It "Should have EndDate parameter" { - $command | Should -HaveParameter EndDate -Type DateTime -Not -Mandatory + $command | Should -HaveParameter EndDate -Type DateTime -Mandatory:$false } It "Should have OutcomeType parameter" { - $command | Should -HaveParameter OutcomeType -Type CompletionResult -Not -Mandatory + $command | Should -HaveParameter OutcomeType -Type CompletionResult -Mandatory:$false } It "Should have ExcludeJobSteps parameter" { - $command | Should -HaveParameter ExcludeJobSteps -Type Switch -Not -Mandatory + $command | Should -HaveParameter ExcludeJobSteps -Type Switch -Mandatory:$false } It "Should have WithOutputFile parameter" { - $command | Should -HaveParameter WithOutputFile -Type Switch -Not -Mandatory + $command | Should -HaveParameter WithOutputFile -Type Switch -Mandatory:$false } It "Should have JobCollection parameter" { - $command | Should -HaveParameter JobCollection -Type Job -Not -Mandatory + $command | Should -HaveParameter JobCollection -Type Job -Mandatory:$false } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $command | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaAgentSchedule.Tests.ps1 b/tests/Get-DbaAgentSchedule.Tests.ps1 index 9c97d7b2fc..45364024b4 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 DbaInstanceParameter[] -Not -Mandatory - $CommandName | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory - $CommandName | Should -HaveParameter Schedule -Type String[] -Not -Mandatory - $CommandName | Should -HaveParameter ScheduleUid -Type String[] -Not -Mandatory - $CommandName | Should -HaveParameter Id -Type Int32[] -Not -Mandatory - $CommandName | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandName | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $CommandName | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $CommandName | Should -HaveParameter Schedule -Type String[] -Mandatory:$false + $CommandName | Should -HaveParameter ScheduleUid -Type String[] -Mandatory:$false + $CommandName | Should -HaveParameter Id -Type Int32[] -Mandatory:$false + $CommandName | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaAgentServer.Tests.ps1 b/tests/Get-DbaAgentServer.Tests.ps1 index 8ce05d6dfa..e817035af2 100644 --- a/tests/Get-DbaAgentServer.Tests.ps1 +++ b/tests/Get-DbaAgentServer.Tests.ps1 @@ -12,49 +12,49 @@ Describe "Get-DbaAgentServer" { $CommandUnderTest = Get-Command Get-DbaAgentServer } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaBackupDevice.Tests.ps1 b/tests/Get-DbaBackupDevice.Tests.ps1 index 124f7da0f7..9ebb1654c6 100644 --- a/tests/Get-DbaBackupDevice.Tests.ps1 +++ b/tests/Get-DbaBackupDevice.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaBackupDevice" { $CommandUnderTest = Get-Command Get-DbaBackupDevice } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Get-DbaBackupInformation.Tests.ps1 b/tests/Get-DbaBackupInformation.Tests.ps1 index b15ac0e266..aff2182e51 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 Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type Object[] -Mandatory:$false } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have DatabaseName parameter" { - $CommandUnderTest | Should -HaveParameter DatabaseName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DatabaseName -Type String[] -Mandatory:$false } It "Should have SourceInstance parameter" { - $CommandUnderTest | Should -HaveParameter SourceInstance -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SourceInstance -Type String[] -Mandatory:$false } It "Should have NoXpDirTree parameter" { - $CommandUnderTest | Should -HaveParameter NoXpDirTree -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoXpDirTree -Type Switch -Mandatory:$false } It "Should have NoXpDirRecurse parameter" { - $CommandUnderTest | Should -HaveParameter NoXpDirRecurse -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoXpDirRecurse -Type Switch -Mandatory:$false } It "Should have DirectoryRecurse parameter" { - $CommandUnderTest | Should -HaveParameter DirectoryRecurse -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DirectoryRecurse -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have MaintenanceSolution parameter" { - $CommandUnderTest | Should -HaveParameter MaintenanceSolution -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaintenanceSolution -Type Switch -Mandatory:$false } It "Should have IgnoreLogBackup parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreLogBackup -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IgnoreLogBackup -Type Switch -Mandatory:$false } It "Should have IgnoreDiffBackup parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreDiffBackup -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IgnoreDiffBackup -Type Switch -Mandatory:$false } It "Should have ExportPath parameter" { - $CommandUnderTest | Should -HaveParameter ExportPath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExportPath -Type String -Mandatory:$false } It "Should have AzureCredential parameter" { - $CommandUnderTest | Should -HaveParameter AzureCredential -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AzureCredential -Type String -Mandatory:$false } It "Should have Import parameter" { - $CommandUnderTest | Should -HaveParameter Import -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Import -Type Switch -Mandatory:$false } It "Should have Anonymise parameter" { - $CommandUnderTest | Should -HaveParameter Anonymise -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Anonymise -Type Switch -Mandatory:$false } It "Should have NoClobber parameter" { - $CommandUnderTest | Should -HaveParameter NoClobber -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoClobber -Type Switch -Mandatory:$false } It "Should have PassThru parameter" { - $CommandUnderTest | Should -HaveParameter PassThru -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PassThru -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaBuild.Tests.ps1 b/tests/Get-DbaBuild.Tests.ps1 index 4019d534db..c780b9e868 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 Version[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Build -Type Version[] -Mandatory:$false } It "Should have Kb parameter" { - $CommandUnderTest | Should -HaveParameter Kb -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Kb -Type String[] -Mandatory:$false } It "Should have MajorVersion parameter" { - $CommandUnderTest | Should -HaveParameter MajorVersion -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MajorVersion -Type String -Mandatory:$false } It "Should have ServicePack parameter" { - $CommandUnderTest | Should -HaveParameter ServicePack -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ServicePack -Type String -Mandatory:$false } It "Should have CumulativeUpdate parameter" { - $CommandUnderTest | Should -HaveParameter CumulativeUpdate -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CumulativeUpdate -Type String -Mandatory:$false } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Update parameter" { - $CommandUnderTest | Should -HaveParameter Update -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Update -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaClientAlias.Tests.ps1 b/tests/Get-DbaClientAlias.Tests.ps1 index 4286936406..6c820a823b 100644 --- a/tests/Get-DbaClientAlias.Tests.ps1 +++ b/tests/Get-DbaClientAlias.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaClientAlias" { $CommandUnderTest = Get-Command Get-DbaClientAlias } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Get-DbaCmConnection.Tests.ps1 b/tests/Get-DbaCmConnection.Tests.ps1 index fdf8cb92ce..2bddbc4a61 100644 --- a/tests/Get-DbaCmConnection.Tests.ps1 +++ b/tests/Get-DbaCmConnection.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaCmConnection" { $CommandUnderTest = Get-Command Get-DbaCmConnection } It "Should have ComputerName as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type String[] -Mandatory:$false } It "Should have UserName as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter UserName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter UserName -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaCmObject.Tests.ps1 b/tests/Get-DbaCmObject.Tests.ps1 index cb1fe01843..817283dcfe 100644 --- a/tests/Get-DbaCmObject.Tests.ps1 +++ b/tests/Get-DbaCmObject.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Get-DbaCmObject" { $CommandUnderTest = Get-Command Get-DbaCmObject } It "Should have ClassName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ClassName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ClassName -Type String -Mandatory:$false } It "Should have Query as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Query -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Query -Type String -Mandatory:$false } It "Should have ComputerName as a non-mandatory DbaCmConnectionParameter[] parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaCmConnectionParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaCmConnectionParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have Namespace as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Namespace -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Namespace -Type String -Mandatory:$false } It "Should have DoNotUse as a non-mandatory ManagementConnectionType[] parameter" { - $CommandUnderTest | Should -HaveParameter DoNotUse -Type ManagementConnectionType[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DoNotUse -Type ManagementConnectionType[] -Mandatory:$false } It "Should have Force as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have SilentlyContinue as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter SilentlyContinue -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SilentlyContinue -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaComputerCertificate.Tests.ps1 b/tests/Get-DbaComputerCertificate.Tests.ps1 index 0b4d8985e6..65d7582fed 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 DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have Store as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Store -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Store -Type String[] -Mandatory:$false } It "Should have Folder as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Folder -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Folder -Type String[] -Mandatory:$false } It "Should have Type as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Type -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String -Mandatory:$false } It "Should have Path as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have Thumbprint as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Thumbprint -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Thumbprint -Type String[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaConnectedInstance.Tests.ps1 b/tests/Get-DbaConnectedInstance.Tests.ps1 index 8543bbea47..f35f0ba5aa 100644 --- a/tests/Get-DbaConnectedInstance.Tests.ps1 +++ b/tests/Get-DbaConnectedInstance.Tests.ps1 @@ -12,18 +12,18 @@ Describe "Get-DbaConnectedInstance" { $CommandUnderTest = Get-Command Get-DbaConnectedInstance } It "Should have the expected parameters" { - $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Not -Mandatory - $CommandUnderTest | Should -HaveParameter Debug -Type switch -Not -Mandatory - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type string -Not -Mandatory - $CommandUnderTest | Should -HaveParameter WarningVariable -Type string -Not -Mandatory - $CommandUnderTest | Should -HaveParameter InformationVariable -Type string -Not -Mandatory - $CommandUnderTest | Should -HaveParameter OutVariable -Type string -Not -Mandatory - $CommandUnderTest | Should -HaveParameter OutBuffer -Type int -Not -Mandatory - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type string -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Debug -Type switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type string -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WarningVariable -Type string -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InformationVariable -Type string -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OutVariable -Type string -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OutBuffer -Type int -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type string -Mandatory:$false } } diff --git a/tests/Get-DbaConnection.Tests.ps1 b/tests/Get-DbaConnection.Tests.ps1 index 9736be7fe0..cdbf13b9f2 100644 --- a/tests/Get-DbaConnection.Tests.ps1 +++ b/tests/Get-DbaConnection.Tests.ps1 @@ -10,13 +10,13 @@ Describe "Get-DbaConnection" { $CommandUnderTest = Get-Command Get-DbaConnection } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Get-DbaCustomError.Tests.ps1 b/tests/Get-DbaCustomError.Tests.ps1 index b2ecef7270..4df3e96d97 100644 --- a/tests/Get-DbaCustomError.Tests.ps1 +++ b/tests/Get-DbaCustomError.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaCustomError" { $CommandUnderTest = Get-Command Get-DbaCustomError } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Get-DbaDBFileGroup.Tests.ps1 b/tests/Get-DbaDBFileGroup.Tests.ps1 index 8485742404..ab59eb4913 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have FileGroup parameter" { - $CommandUnderTest | Should -HaveParameter FileGroup -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FileGroup -Type String[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDatabase.Tests.ps1 b/tests/Get-DbaDatabase.Tests.ps1 index 7649158266..8e78bc250f 100644 --- a/tests/Get-DbaDatabase.Tests.ps1 +++ b/tests/Get-DbaDatabase.Tests.ps1 @@ -6,58 +6,58 @@ Describe "Get-DbaDatabase" { $CommandUnderTest = Get-Command Get-DbaDatabase } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have ExcludeUser as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeUser -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeUser -Type Switch -Mandatory:$false } It "Should have ExcludeSystem as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystem -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSystem -Type Switch -Mandatory:$false } It "Should have Owner as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Owner -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Owner -Type String[] -Mandatory:$false } It "Should have Encrypted as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Encrypted -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Encrypted -Type Switch -Mandatory:$false } It "Should have Status as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Status -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Status -Type String[] -Mandatory:$false } It "Should have Access as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Access -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Access -Type String -Mandatory:$false } It "Should have RecoveryModel as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter RecoveryModel -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RecoveryModel -Type String[] -Mandatory:$false } It "Should have NoFullBackup as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter NoFullBackup -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoFullBackup -Type Switch -Mandatory:$false } It "Should have NoFullBackupSince as a non-mandatory parameter of type DateTime" { - $CommandUnderTest | Should -HaveParameter NoFullBackupSince -Type DateTime -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoFullBackupSince -Type DateTime -Mandatory:$false } It "Should have NoLogBackup as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter NoLogBackup -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoLogBackup -Type Switch -Mandatory:$false } It "Should have NoLogBackupSince as a non-mandatory parameter of type DateTime" { - $CommandUnderTest | Should -HaveParameter NoLogBackupSince -Type DateTime -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoLogBackupSince -Type DateTime -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have IncludeLastUsed as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeLastUsed -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeLastUsed -Type Switch -Mandatory:$false } It "Should have OnlyAccessible as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter OnlyAccessible -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OnlyAccessible -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbBackupHistory.Tests.ps1 b/tests/Get-DbaDbBackupHistory.Tests.ps1 index 7a9f641d39..d37345f880 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have IncludeCopyOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeCopyOnly -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeCopyOnly -Type switch -Mandatory:$false } It "Should have Force as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type switch -Mandatory:$false } It "Should have Since as a parameter" { - $CommandUnderTest | Should -HaveParameter Since -Type PSObject -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Since -Type PSObject -Mandatory:$false } It "Should have RecoveryFork as a parameter" { - $CommandUnderTest | Should -HaveParameter RecoveryFork -Type string -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RecoveryFork -Type string -Mandatory:$false } It "Should have Last as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Last -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Last -Type switch -Mandatory:$false } It "Should have LastFull as a switch parameter" { - $CommandUnderTest | Should -HaveParameter LastFull -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LastFull -Type switch -Mandatory:$false } It "Should have LastDiff as a switch parameter" { - $CommandUnderTest | Should -HaveParameter LastDiff -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LastDiff -Type switch -Mandatory:$false } It "Should have LastLog as a switch parameter" { - $CommandUnderTest | Should -HaveParameter LastLog -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LastLog -Type switch -Mandatory:$false } It "Should have DeviceType as a parameter" { - $CommandUnderTest | Should -HaveParameter DeviceType -Type string[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DeviceType -Type string[] -Mandatory:$false } It "Should have Raw as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Raw -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Raw -Type switch -Mandatory:$false } It "Should have LastLsn as a parameter" { - $CommandUnderTest | Should -HaveParameter LastLsn -Type BigInteger -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LastLsn -Type BigInteger -Mandatory:$false } It "Should have IncludeMirror as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeMirror -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeMirror -Type switch -Mandatory:$false } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type string[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type string[] -Mandatory:$false } It "Should have AgCheck as a switch parameter" { - $CommandUnderTest | Should -HaveParameter AgCheck -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AgCheck -Type switch -Mandatory:$false } It "Should have IgnoreDiffBackup as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreDiffBackup -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IgnoreDiffBackup -Type switch -Mandatory:$false } It "Should have LsnSort as a parameter" { - $CommandUnderTest | Should -HaveParameter LsnSort -Type string -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LsnSort -Type string -Mandatory:$false } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } } diff --git a/tests/Get-DbaDbCertificate.Tests.ps1 b/tests/Get-DbaDbCertificate.Tests.ps1 index 78a7b52e97..8ac6bf5fa2 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have Certificate as a parameter" { - $CommandUnderTest | Should -HaveParameter Certificate -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Certificate -Type Object[] -Mandatory:$false } It "Should have Subject as a parameter" { - $CommandUnderTest | Should -HaveParameter Subject -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Subject -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbCheckConstraint.Tests.ps1 b/tests/Get-DbaDbCheckConstraint.Tests.ps1 index 3ab542e1ca..09d2506910 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have ExcludeSystemTable as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemTable -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSystemTable -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaDbCompression.Tests.ps1 b/tests/Get-DbaDbCompression.Tests.ps1 index 891bcd1591..c17bf6e8e5 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have Table as a parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Table -Type String[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbEncryptionKey.Tests.ps1 b/tests/Get-DbaDbEncryptionKey.Tests.ps1 index f97a018cb1..9969d6a32a 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbFile.Tests.ps1 b/tests/Get-DbaDbFile.Tests.ps1 index c291ff9224..c4b39409bc 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have FileGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter FileGroup -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FileGroup -Type Object[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbFileGrowth.Tests.ps1 b/tests/Get-DbaDbFileGrowth.Tests.ps1 index 8bd1dca799..0db2c46cce 100644 --- a/tests/Get-DbaDbFileGrowth.Tests.ps1 +++ b/tests/Get-DbaDbFileGrowth.Tests.ps1 @@ -10,55 +10,55 @@ Describe "Get-DbaDbFileGrowth" { $CommandUnderTest = Get-Command Get-DbaDbFileGrowth } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaDbLogShipError.Tests.ps1 b/tests/Get-DbaDbLogShipError.Tests.ps1 index ba6d7965bb..a919a35eec 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 DbaInstanceParameter[] -Not -Mandatory + $CommandName | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandName | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandName | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandName | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandName | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase as a parameter" { - $CommandName | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $CommandName | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have Action as a parameter" { - $CommandName | Should -HaveParameter Action -Type String[] -Not -Mandatory + $CommandName | Should -HaveParameter Action -Type String[] -Mandatory:$false } It "Should have DateTimeFrom as a parameter" { - $CommandName | Should -HaveParameter DateTimeFrom -Type DateTime -Not -Mandatory + $CommandName | Should -HaveParameter DateTimeFrom -Type DateTime -Mandatory:$false } It "Should have DateTimeTo as a parameter" { - $CommandName | Should -HaveParameter DateTimeTo -Type DateTime -Not -Mandatory + $CommandName | Should -HaveParameter DateTimeTo -Type DateTime -Mandatory:$false } It "Should have Primary as a parameter" { - $CommandName | Should -HaveParameter Primary -Type Switch -Not -Mandatory + $CommandName | Should -HaveParameter Primary -Type Switch -Mandatory:$false } It "Should have Secondary as a parameter" { - $CommandName | Should -HaveParameter Secondary -Type Switch -Not -Mandatory + $CommandName | Should -HaveParameter Secondary -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandName | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandName | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaDbLogSpace.Tests.ps1 b/tests/Get-DbaDbLogSpace.Tests.ps1 index df50380603..85d6f413b5 100644 --- a/tests/Get-DbaDbLogSpace.Tests.ps1 +++ b/tests/Get-DbaDbLogSpace.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaDbLogSpace" { $CommandUnderTest = Get-Command Get-DbaDbLogSpace } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have ExcludeSystemDatabase as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemDatabase -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSystemDatabase -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbMail.Tests.ps1 b/tests/Get-DbaDbMail.Tests.ps1 index acadfb1668..b0b20f1aa7 100644 --- a/tests/Get-DbaDbMail.Tests.ps1 +++ b/tests/Get-DbaDbMail.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaDbMail" { $CommandUnderTest = Get-Command Get-DbaDbMail } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbMailAccount.Tests.ps1 b/tests/Get-DbaDbMailAccount.Tests.ps1 index aaac3d1728..deb642f170 100644 --- a/tests/Get-DbaDbMailAccount.Tests.ps1 +++ b/tests/Get-DbaDbMailAccount.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaDbMailAccount" { $CommandUnderTest = Get-Command Get-DbaDbMailAccount } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Account as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Account -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Account -Type String[] -Mandatory:$false } It "Should have ExcludeAccount as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeAccount -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeAccount -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type SqlMail[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type SqlMail[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type SqlMail[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbMailConfig.Tests.ps1 b/tests/Get-DbaDbMailConfig.Tests.ps1 index bc58fed81f..06b3057b0b 100644 --- a/tests/Get-DbaDbMailConfig.Tests.ps1 +++ b/tests/Get-DbaDbMailConfig.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Get-DbaDbMailConfig" { $CommandUnderTest = Get-Command Get-DbaDbMailConfig } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Name as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Name -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type SqlMail[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type SqlMail[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type SqlMail[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbMailProfile.Tests.ps1 b/tests/Get-DbaDbMailProfile.Tests.ps1 index d37b698943..60456f83e2 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Profile as a parameter" { - $CommandUnderTest | Should -HaveParameter Profile -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Profile -Type String[] -Mandatory:$false } It "Should have ExcludeProfile as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeProfile -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeProfile -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type SqlMail[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type SqlMail[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaDbMailServer.Tests.ps1 b/tests/Get-DbaDbMailServer.Tests.ps1 index 97eba2f347..823c23f114 100644 --- a/tests/Get-DbaDbMailServer.Tests.ps1 +++ b/tests/Get-DbaDbMailServer.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaDbMailServer" { $CommandUnderTest = Get-Command Get-DbaDbMailServer } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Server as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Server -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Server -Type String[] -Mandatory:$false } It "Should have Account as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Account -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Account -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type SqlMail[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type SqlMail[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type SqlMail[] -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbMirror.Tests.ps1 b/tests/Get-DbaDbMirror.Tests.ps1 index 0393fcb2d7..c01005137d 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbMirrorMonitor.Tests.ps1 b/tests/Get-DbaDbMirrorMonitor.Tests.ps1 index b8023f0dfe..e6d163e395 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have Update parameter" { - $CommandUnderTest | Should -HaveParameter Update -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Update -Type Switch -Mandatory:$false } It "Should have LimitResults parameter" { - $CommandUnderTest | Should -HaveParameter LimitResults -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LimitResults -Type String -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaDbPageInfo.Tests.ps1 b/tests/Get-DbaDbPageInfo.Tests.ps1 index b80bb27b65..6bd60f6b5a 100644 --- a/tests/Get-DbaDbPageInfo.Tests.ps1 +++ b/tests/Get-DbaDbPageInfo.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Get-DbaDbPageInfo" { $CommandUnderTest = Get-Command Get-DbaDbPageInfo } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have Schema as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Mandatory:$false } It "Should have Table as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Table -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Table -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbPartitionFunction.Tests.ps1 b/tests/Get-DbaDbPartitionFunction.Tests.ps1 index 7e64fdc507..ac401e8f5f 100644 --- a/tests/Get-DbaDbPartitionFunction.Tests.ps1 +++ b/tests/Get-DbaDbPartitionFunction.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaDbPartitionFunction" { $CommandUnderTest = Get-Command Get-DbaDbPartitionFunction } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have PartitionFunction as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter PartitionFunction -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PartitionFunction -Type String[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbPartitionScheme.Tests.ps1 b/tests/Get-DbaDbPartitionScheme.Tests.ps1 index 0ef23dc1d0..bde6eca2ff 100644 --- a/tests/Get-DbaDbPartitionScheme.Tests.ps1 +++ b/tests/Get-DbaDbPartitionScheme.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaDbPartitionScheme" { $CommandUnderTest = Get-Command Get-DbaDbPartitionScheme } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have PartitionScheme as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter PartitionScheme -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PartitionScheme -Type String[] -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaDbRecoveryModel.Tests.ps1 b/tests/Get-DbaDbRecoveryModel.Tests.ps1 index 8e9d9c9f20..2a9e6c91e3 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have RecoveryModel as a parameter" { - $CommandUnderTest | Should -HaveParameter RecoveryModel -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RecoveryModel -Type String[] -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbRole.Tests.ps1 b/tests/Get-DbaDbRole.Tests.ps1 index 943b7cdec2..b779d12f8d 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have Role parameter" { - $CommandUnderTest | Should -HaveParameter Role -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Role -Type String[] -Mandatory:$false } It "Should have ExcludeRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeRole -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeRole -Type String[] -Mandatory:$false } It "Should have ExcludeFixedRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeFixedRole -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeFixedRole -Type Switch -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbRoleMember.Tests.ps1 b/tests/Get-DbaDbRoleMember.Tests.ps1 index 5023548a27..ee794c5a16 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have Role as a parameter" { - $CommandUnderTest | Should -HaveParameter Role -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Role -Type String[] -Mandatory:$false } It "Should have ExcludeRole as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeRole -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeRole -Type String[] -Mandatory:$false } It "Should have ExcludeFixedRole as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeFixedRole -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeFixedRole -Type Switch -Mandatory:$false } It "Should have IncludeSystemUser as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemUser -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeSystemUser -Type Switch -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaDbSpace.Tests.ps1 b/tests/Get-DbaDbSpace.Tests.ps1 index 56f5022dc7..f1d20fdf12 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 DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have IncludeSystemDBs as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemDBs -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeSystemDBs -Type Switch -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbStoredProcedure.Tests.ps1 b/tests/Get-DbaDbStoredProcedure.Tests.ps1 index deeb9af6ea..abc38fdb7e 100644 --- a/tests/Get-DbaDbStoredProcedure.Tests.ps1 +++ b/tests/Get-DbaDbStoredProcedure.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Get-DbaDbStoredProcedure Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaDbStoredProcedure } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have ExcludeSystemSp as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemSp -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSystemSp -Type Switch -Mandatory:$false } It "Should have Name as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Name -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String[] -Mandatory:$false } It "Should have Schema as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaDbTrigger.Tests.ps1 b/tests/Get-DbaDbTrigger.Tests.ps1 index 88a18aa227..c93f3a1052 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaDbccHelp.Tests.ps1 b/tests/Get-DbaDbccHelp.Tests.ps1 index cf0314c3e9..31426d4fe9 100644 --- a/tests/Get-DbaDbccHelp.Tests.ps1 +++ b/tests/Get-DbaDbccHelp.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Get-DbaDbccHelp" { $CommandUnderTest = Get-Command Get-DbaDbccHelp } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Statement as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Statement -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Statement -Type String -Mandatory:$false } It "Should have IncludeUndocumented as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeUndocumented -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeUndocumented -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbccMemoryStatus.Tests.ps1 b/tests/Get-DbaDbccMemoryStatus.Tests.ps1 index ed06dab95c..20650d43cd 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDbccProcCache.Tests.ps1 b/tests/Get-DbaDbccProcCache.Tests.ps1 index 784e962300..5f089ff002 100644 --- a/tests/Get-DbaDbccProcCache.Tests.ps1 +++ b/tests/Get-DbaDbccProcCache.Tests.ps1 @@ -6,49 +6,49 @@ Describe "Get-DbaDbccProcCache" { $CommandUnderTest = Get-Command Get-DbaDbccProcCache } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaDbccUserOption.Tests.ps1 b/tests/Get-DbaDbccUserOption.Tests.ps1 index 41f9ef6787..7b0bccd44a 100644 --- a/tests/Get-DbaDbccUserOption.Tests.ps1 +++ b/tests/Get-DbaDbccUserOption.Tests.ps1 @@ -10,16 +10,16 @@ Describe "Get-DbaDbccUserOption" { $CommandUnderTest = Get-Command Get-DbaDbccUserOption } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Option as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Option -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Option -Type String[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDefaultPath.Tests.ps1 b/tests/Get-DbaDefaultPath.Tests.ps1 index 55362d29c8..eede78af41 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaDependency.Tests.ps1 b/tests/Get-DbaDependency.Tests.ps1 index 35a344c37d..fd7ebd38ea 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 Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object -Mandatory:$false } It "Should have AllowSystemObjects as a parameter" { - $CommandUnderTest | Should -HaveParameter AllowSystemObjects -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AllowSystemObjects -Type Switch -Mandatory:$false } It "Should have Parents as a parameter" { - $CommandUnderTest | Should -HaveParameter Parents -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Parents -Type Switch -Mandatory:$false } It "Should have IncludeSelf as a parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSelf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeSelf -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaDeprecatedFeature.Tests.ps1 b/tests/Get-DbaDeprecatedFeature.Tests.ps1 index 9a4dd8e087..f7913dbbdb 100644 --- a/tests/Get-DbaDeprecatedFeature.Tests.ps1 +++ b/tests/Get-DbaDeprecatedFeature.Tests.ps1 @@ -10,49 +10,49 @@ Describe "Get-DbaDeprecatedFeature" { $CommandUnderTest = Get-Command Get-DbaDeprecatedFeature } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaErrorLogConfig.Tests.ps1 b/tests/Get-DbaErrorLogConfig.Tests.ps1 index 79bd109d8b..5e5d01bd71 100644 --- a/tests/Get-DbaErrorLogConfig.Tests.ps1 +++ b/tests/Get-DbaErrorLogConfig.Tests.ps1 @@ -12,49 +12,49 @@ Describe "Get-DbaErrorLogConfig" { $CommandUnderTest = Get-Command Get-DbaErrorLogConfig } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaEstimatedCompletionTime.Tests.ps1 b/tests/Get-DbaEstimatedCompletionTime.Tests.ps1 index 77ca21f225..d807006367 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaExtendedProtection.Tests.ps1 b/tests/Get-DbaExtendedProtection.Tests.ps1 index e9f5e53fd0..413e0f112f 100644 --- a/tests/Get-DbaExtendedProtection.Tests.ps1 +++ b/tests/Get-DbaExtendedProtection.Tests.ps1 @@ -10,55 +10,55 @@ Describe "Get-DbaExtendedProtection" { $CommandUnderTest = Get-Command Get-DbaExtendedProtection } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaFile.Tests.ps1 b/tests/Get-DbaFile.Tests.ps1 index d0dc894975..734571cd47 100644 --- a/tests/Get-DbaFile.Tests.ps1 +++ b/tests/Get-DbaFile.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaFile" { $CommandUnderTest = Get-Command Get-DbaFile } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Path as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Path -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String[] -Mandatory:$false } It "Should have FileType as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter FileType -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FileType -Type String[] -Mandatory:$false } It "Should have Depth as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter Depth -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Depth -Type Int32 -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaFilestream.Tests.ps1 b/tests/Get-DbaFilestream.Tests.ps1 index dc321e3b4c..4a79abb7c6 100644 --- a/tests/Get-DbaFilestream.Tests.ps1 +++ b/tests/Get-DbaFilestream.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Get-DbaFilestream" { $CommandUnderTest = Get-Command Get-DbaFilestream } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Get-DbaHideInstance.Tests.ps1 b/tests/Get-DbaHideInstance.Tests.ps1 index 3dc7edd0a3..53576cdb76 100644 --- a/tests/Get-DbaHideInstance.Tests.ps1 +++ b/tests/Get-DbaHideInstance.Tests.ps1 @@ -10,49 +10,49 @@ Describe "Get-DbaHideInstance" { $CommandUnderTest = Get-Command Get-DbaHideInstance } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaInstalledPatch.Tests.ps1 b/tests/Get-DbaInstalledPatch.Tests.ps1 index fd0cbdeb51..60c467c759 100644 --- a/tests/Get-DbaInstalledPatch.Tests.ps1 +++ b/tests/Get-DbaInstalledPatch.Tests.ps1 @@ -10,49 +10,49 @@ Describe "Get-DbaInstalledPatch" { $CommandUnderTest = Get-Command Get-DbaInstalledPatch } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaInstanceAuditSpecification.Tests.ps1 b/tests/Get-DbaInstanceAuditSpecification.Tests.ps1 index 8d4ccf3200..398b46852e 100644 --- a/tests/Get-DbaInstanceAuditSpecification.Tests.ps1 +++ b/tests/Get-DbaInstanceAuditSpecification.Tests.ps1 @@ -6,49 +6,49 @@ Describe "Get-DbaInstanceAuditSpecification" { $CommandUnderTest = Get-Command Get-DbaInstanceAuditSpecification } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } } diff --git a/tests/Get-DbaInstanceProperty.Tests.ps1 b/tests/Get-DbaInstanceProperty.Tests.ps1 index e7d6803f6c..22e0055ada 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 DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have InstanceProperty as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter InstanceProperty -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InstanceProperty -Type Object[] -Mandatory:$false } It "Should have ExcludeInstanceProperty as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeInstanceProperty -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeInstanceProperty -Type Object[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Get-DbaInstanceProtocol.Tests.ps1 b/tests/Get-DbaInstanceProtocol.Tests.ps1 index 00d81be74a..afd22729ea 100644 --- a/tests/Get-DbaInstanceProtocol.Tests.ps1 +++ b/tests/Get-DbaInstanceProtocol.Tests.ps1 @@ -10,13 +10,13 @@ Describe "Get-DbaInstanceProtocol" { $CommandUnderTest = Get-Command Get-DbaInstanceProtocol } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Get-DbaInstanceTrigger.Tests.ps1 b/tests/Get-DbaInstanceTrigger.Tests.ps1 index ab12357efa..bfa30b00b6 100644 --- a/tests/Get-DbaInstanceTrigger.Tests.ps1 +++ b/tests/Get-DbaInstanceTrigger.Tests.ps1 @@ -12,49 +12,49 @@ Describe "Get-DbaInstanceTrigger Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Get-DbaInstanceTrigger } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } } diff --git a/tests/Get-DbaIoLatency.Tests.ps1 b/tests/Get-DbaIoLatency.Tests.ps1 index cd9935426f..5a38a86740 100644 --- a/tests/Get-DbaIoLatency.Tests.ps1 +++ b/tests/Get-DbaIoLatency.Tests.ps1 @@ -6,49 +6,49 @@ Describe "Get-DbaIoLatency" { $CommandUnderTest = Get-Command Get-DbaIoLatency } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaKbUpdate.Tests.ps1 b/tests/Get-DbaKbUpdate.Tests.ps1 index e0a4107566..9ae6fe1f16 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 String[] parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String[] -Mandatory:$false } It "Should have Simple as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Simple -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Simple -Type Switch -Mandatory:$false } It "Should have Language as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Language -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Language -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaLastBackup.Tests.ps1 b/tests/Get-DbaLastBackup.Tests.ps1 index ae84e4c271..4e7fa4611a 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 DbaInstanceParameter[] -Not -Mandatory + $Command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $Command | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $Command | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $Command | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $Command | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $Command | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $Command | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have EnableException parameter" { - $Command | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $Command | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaLatchStatistic.Tests.ps1 b/tests/Get-DbaLatchStatistic.Tests.ps1 index de88dec226..6ffd20c140 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Threshold as a parameter" { - $CommandUnderTest | Should -HaveParameter Threshold -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Threshold -Type Int32 -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaLinkedServer.Tests.ps1 b/tests/Get-DbaLinkedServer.Tests.ps1 index 7026b164bd..6e32c4d71a 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 DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have LinkedServer as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter LinkedServer -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LinkedServer -Type Object[] -Mandatory:$false } It "Should have ExcludeLinkedServer as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeLinkedServer -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeLinkedServer -Type Object[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaLinkedServerLogin.Tests.ps1 b/tests/Get-DbaLinkedServerLogin.Tests.ps1 index 4c93836aae..b044b564ff 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have LinkedServer as a parameter" { - $CommandUnderTest | Should -HaveParameter LinkedServer -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LinkedServer -Type String[] -Mandatory:$false } It "Should have LocalLogin as a parameter" { - $CommandUnderTest | Should -HaveParameter LocalLogin -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LocalLogin -Type String[] -Mandatory:$false } It "Should have ExcludeLocalLogin as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeLocalLogin -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeLocalLogin -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaLocaleSetting.Tests.ps1 b/tests/Get-DbaLocaleSetting.Tests.ps1 index 7ef93f62dd..42ba6996f4 100644 --- a/tests/Get-DbaLocaleSetting.Tests.ps1 +++ b/tests/Get-DbaLocaleSetting.Tests.ps1 @@ -12,49 +12,49 @@ Describe "Get-DbaLocaleSetting" { $CommandUnderTest = Get-Command Get-DbaLocaleSetting } It "Should have ComputerName as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type String[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaLogin.Tests.ps1 b/tests/Get-DbaLogin.Tests.ps1 index 067ecb1f25..9563c60c94 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Login parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Login -Type String[] -Mandatory:$false } It "Should have IncludeFilter parameter" { - $CommandUnderTest | Should -HaveParameter IncludeFilter -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeFilter -Type String[] -Mandatory:$false } It "Should have ExcludeLogin parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeLogin -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeLogin -Type String[] -Mandatory:$false } It "Should have ExcludeFilter parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeFilter -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeFilter -Type String[] -Mandatory:$false } It "Should have ExcludeSystemLogin parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemLogin -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSystemLogin -Type Switch -Mandatory:$false } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String -Mandatory:$false } It "Should have HasAccess parameter" { - $CommandUnderTest | Should -HaveParameter HasAccess -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter HasAccess -Type Switch -Mandatory:$false } It "Should have Locked parameter" { - $CommandUnderTest | Should -HaveParameter Locked -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Locked -Type Switch -Mandatory:$false } It "Should have Disabled parameter" { - $CommandUnderTest | Should -HaveParameter Disabled -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Disabled -Type Switch -Mandatory:$false } It "Should have MustChangePassword parameter" { - $CommandUnderTest | Should -HaveParameter MustChangePassword -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MustChangePassword -Type Switch -Mandatory:$false } It "Should have Detailed parameter" { - $CommandUnderTest | Should -HaveParameter Detailed -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Detailed -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaMaxMemory.Tests.ps1 b/tests/Get-DbaMaxMemory.Tests.ps1 index 184470382a..363ac0efd9 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaMemoryCondition.Tests.ps1 b/tests/Get-DbaMemoryCondition.Tests.ps1 index a0ca5de4a5..33d9c0a615 100644 --- a/tests/Get-DbaMemoryCondition.Tests.ps1 +++ b/tests/Get-DbaMemoryCondition.Tests.ps1 @@ -6,49 +6,49 @@ Describe "Get-DbaMemoryCondition" { $CommandUnderTest = Get-Command Get-DbaMemoryCondition } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } } diff --git a/tests/Get-DbaModule.Tests.ps1 b/tests/Get-DbaModule.Tests.ps1 index 3a8c4fcf63..e8854c2f58 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 DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have ModifiedSince as a non-mandatory parameter of type DateTime" { - $CommandUnderTest | Should -HaveParameter ModifiedSince -Type DateTime -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ModifiedSince -Type DateTime -Mandatory:$false } It "Should have Type as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Type -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String[] -Mandatory:$false } It "Should have ExcludeSystemDatabases as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemDatabases -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSystemDatabases -Type Switch -Mandatory:$false } It "Should have ExcludeSystemObjects as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemObjects -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSystemObjects -Type Switch -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaMsdtc.Tests.ps1 b/tests/Get-DbaMsdtc.Tests.ps1 index 3246f0f71c..fed7f3975e 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaNetworkActivity.Tests.ps1 b/tests/Get-DbaNetworkActivity.Tests.ps1 index c38df86fcc..7001604f85 100644 --- a/tests/Get-DbaNetworkActivity.Tests.ps1 +++ b/tests/Get-DbaNetworkActivity.Tests.ps1 @@ -12,27 +12,27 @@ Describe "Get-DbaNetworkActivity" { $CommandUnderTest = Get-Command Get-DbaNetworkActivity } It "Should have ComputerName as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type String[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have common parameters" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaOleDbProvider.Tests.ps1 b/tests/Get-DbaOleDbProvider.Tests.ps1 index 22abe5276e..27f546b5b1 100644 --- a/tests/Get-DbaOleDbProvider.Tests.ps1 +++ b/tests/Get-DbaOleDbProvider.Tests.ps1 @@ -6,52 +6,52 @@ Describe "Get-DbaOleDbProvider" { $CommandUnderTest = Get-Command Get-DbaOleDbProvider } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Provider as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Provider -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Provider -Type String[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaPageFileSetting.Tests.ps1 b/tests/Get-DbaPageFileSetting.Tests.ps1 index 58d80cf8bc..b88cf7b0da 100644 --- a/tests/Get-DbaPageFileSetting.Tests.ps1 +++ b/tests/Get-DbaPageFileSetting.Tests.ps1 @@ -12,49 +12,49 @@ Describe "Get-DbaPageFileSetting" { $CommandUnderTest = Get-Command Get-DbaPageFileSetting } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaPbmCategory.Tests.ps1 b/tests/Get-DbaPbmCategory.Tests.ps1 index 571c2d20e6..78eb374b77 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Category as a parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Category -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject[] -Mandatory:$false } It "Should have ExcludeSystemObject as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemObject -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSystemObject -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaPbmCategorySubscription.Tests.ps1 b/tests/Get-DbaPbmCategorySubscription.Tests.ps1 index a60c42ed9f..c2364b88ce 100644 --- a/tests/Get-DbaPbmCategorySubscription.Tests.ps1 +++ b/tests/Get-DbaPbmCategorySubscription.Tests.ps1 @@ -6,52 +6,52 @@ Describe "Get-DbaPbmCategorySubscription" { $CommandUnderTest = Get-Command Get-DbaPbmCategorySubscription } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type PSObject[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaPbmCondition.Tests.ps1 b/tests/Get-DbaPbmCondition.Tests.ps1 index c75eb913e3..15cf9c1ff9 100644 --- a/tests/Get-DbaPbmCondition.Tests.ps1 +++ b/tests/Get-DbaPbmCondition.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaPbmCondition" { $CommandUnderTest = Get-Command Get-DbaPbmCondition } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Condition as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Condition -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Condition -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type PSObject[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject[] -Mandatory:$false } It "Should have IncludeSystemObject as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemObject -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeSystemObject -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaPbmStore.Tests.ps1 b/tests/Get-DbaPbmStore.Tests.ps1 index e1261af985..ed0359215d 100644 --- a/tests/Get-DbaPbmStore.Tests.ps1 +++ b/tests/Get-DbaPbmStore.Tests.ps1 @@ -12,49 +12,49 @@ Describe "Get-DbaPbmStore" { $CommandUnderTest = Get-Command Get-DbaPbmStore } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } } diff --git a/tests/Get-DbaPermission.Tests.ps1 b/tests/Get-DbaPermission.Tests.ps1 index ccd160aeed..1970383436 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have IncludeServerLevel as a switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeServerLevel -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeServerLevel -Type Switch -Mandatory:$false } It "Should have ExcludeSystemObjects as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemObjects -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSystemObjects -Type Switch -Mandatory:$false } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaPfDataCollectorSet.Tests.ps1 b/tests/Get-DbaPfDataCollectorSet.Tests.ps1 index fa9a5ef2e3..2a2e054a33 100644 --- a/tests/Get-DbaPfDataCollectorSet.Tests.ps1 +++ b/tests/Get-DbaPfDataCollectorSet.Tests.ps1 @@ -10,16 +10,16 @@ Describe "Get-DbaPfDataCollectorSet" { $CommandUnderTest = Get-Command Get-DbaPfDataCollectorSet } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have CollectorSet as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter CollectorSet -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CollectorSet -Type String[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaPfDataCollectorSetTemplate.Tests.ps1 b/tests/Get-DbaPfDataCollectorSetTemplate.Tests.ps1 index c836d30372..7601760ed1 100644 --- a/tests/Get-DbaPfDataCollectorSetTemplate.Tests.ps1 +++ b/tests/Get-DbaPfDataCollectorSetTemplate.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Get-DbaPfDataCollectorSetTemplate" { $CommandUnderTest = Get-Command Get-DbaPfDataCollectorSetTemplate } It "Should have Path as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String[] -Mandatory:$false } It "Should have Pattern as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Pattern -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Pattern -Type String -Mandatory:$false } It "Should have Template as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Template -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Template -Type String[] -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaPrivilege.Tests.ps1 b/tests/Get-DbaPrivilege.Tests.ps1 index 7c7bb2bbb5..c672a1d277 100644 --- a/tests/Get-DbaPrivilege.Tests.ps1 +++ b/tests/Get-DbaPrivilege.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaPrivilege" { $CommandUnderTest = Get-Command Get-DbaPrivilege } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Get-DbaProcess.Tests.ps1 b/tests/Get-DbaProcess.Tests.ps1 index a04b28b723..a5899b99b9 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Spid as a parameter" { - $CommandUnderTest | Should -HaveParameter Spid -Type Int32[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Spid -Type Int32[] -Mandatory:$false } It "Should have ExcludeSpid as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSpid -Type Int32[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSpid -Type Int32[] -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Login -Type String[] -Mandatory:$false } It "Should have Hostname as a parameter" { - $CommandUnderTest | Should -HaveParameter Hostname -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Hostname -Type String[] -Mandatory:$false } It "Should have Program as a parameter" { - $CommandUnderTest | Should -HaveParameter Program -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Program -Type String[] -Mandatory:$false } It "Should have ExcludeSystemSpids as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemSpids -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSystemSpids -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaProductKey.Tests.ps1 b/tests/Get-DbaProductKey.Tests.ps1 index 55d1724514..73df2d4368 100644 --- a/tests/Get-DbaProductKey.Tests.ps1 +++ b/tests/Get-DbaProductKey.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Get-DbaProductKey" { $CommandUnderTest = Get-Command Get-DbaProductKey } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Get-DbaQueryExecutionTime.Tests.ps1 b/tests/Get-DbaQueryExecutionTime.Tests.ps1 index 98d80c699b..34de1071a1 100644 --- a/tests/Get-DbaQueryExecutionTime.Tests.ps1 +++ b/tests/Get-DbaQueryExecutionTime.Tests.ps1 @@ -6,31 +6,31 @@ Describe "Get-DbaQueryExecutionTime" { $CommandUnderTest = Get-Command Get-DbaQueryExecutionTime } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have MaxResultsPerDb as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter MaxResultsPerDb -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaxResultsPerDb -Type Int32 -Mandatory:$false } It "Should have MinExecs as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter MinExecs -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MinExecs -Type Int32 -Mandatory:$false } It "Should have MinExecMs as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter MinExecMs -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MinExecMs -Type Int32 -Mandatory:$false } It "Should have ExcludeSystem as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystem -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSystem -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaRandomizedDataset.Tests.ps1 b/tests/Get-DbaRandomizedDataset.Tests.ps1 index 8f07f3761b..5bffb5e959 100644 --- a/tests/Get-DbaRandomizedDataset.Tests.ps1 +++ b/tests/Get-DbaRandomizedDataset.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaRandomizedDataset" { $CommandUnderTest = Get-Command Get-DbaRandomizedDataset } It "Should have Template as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Template -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Template -Type String[] -Mandatory:$false } It "Should have TemplateFile as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter TemplateFile -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter TemplateFile -Type String[] -Mandatory:$false } It "Should have Rows as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter Rows -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Rows -Type Int32 -Mandatory:$false } It "Should have Locale as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Locale -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Locale -Type String -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaRandomizedDatasetTemplate.Tests.ps1 b/tests/Get-DbaRandomizedDatasetTemplate.Tests.ps1 index 06bb955b20..0ebaf3d4dc 100644 --- a/tests/Get-DbaRandomizedDatasetTemplate.Tests.ps1 +++ b/tests/Get-DbaRandomizedDatasetTemplate.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Get-DbaRandomizedDatasetTemplate" { $CommandUnderTest = Get-Command Get-DbaRandomizedDatasetTemplate } It "Should have Template as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Template -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Template -Type String[] -Mandatory:$false } It "Should have Path as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Path -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String[] -Mandatory:$false } It "Should have ExcludeDefault as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDefault -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDefault -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaRandomizedType.Tests.ps1 b/tests/Get-DbaRandomizedType.Tests.ps1 index e10a48c0b4..b4316355b1 100644 --- a/tests/Get-DbaRandomizedType.Tests.ps1 +++ b/tests/Get-DbaRandomizedType.Tests.ps1 @@ -11,16 +11,16 @@ Describe "Get-DbaRandomizedType" { $CommandUnderTest = Get-Command Get-DbaRandomizedType } It "Should have RandomizedType as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter RandomizedType -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RandomizedType -Type String[] -Mandatory:$false } It "Should have RandomizedSubType as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter RandomizedSubType -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RandomizedSubType -Type String[] -Mandatory:$false } It "Should have Pattern as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Pattern -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Pattern -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaRandomizedValue.Tests.ps1 b/tests/Get-DbaRandomizedValue.Tests.ps1 index cd59d7ebdc..67e18a0df3 100644 --- a/tests/Get-DbaRandomizedValue.Tests.ps1 +++ b/tests/Get-DbaRandomizedValue.Tests.ps1 @@ -6,43 +6,43 @@ Describe "Get-DbaRandomizedValue" { $CommandUnderTest = Get-Command Get-DbaRandomizedValue } It "Should have DataType as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter DataType -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DataType -Type String -Mandatory:$false } It "Should have RandomizerType as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter RandomizerType -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RandomizerType -Type String -Mandatory:$false } It "Should have RandomizerSubType as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter RandomizerSubType -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RandomizerSubType -Type String -Mandatory:$false } It "Should have Min as a non-mandatory Object parameter" { - $CommandUnderTest | Should -HaveParameter Min -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Min -Type Object -Mandatory:$false } It "Should have Max as a non-mandatory Object parameter" { - $CommandUnderTest | Should -HaveParameter Max -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Max -Type Object -Mandatory:$false } It "Should have Precision as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter Precision -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Precision -Type Int32 -Mandatory:$false } It "Should have CharacterString as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter CharacterString -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CharacterString -Type String -Mandatory:$false } It "Should have Format as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Format -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Format -Type String -Mandatory:$false } It "Should have Symbol as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Symbol -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Symbol -Type String -Mandatory:$false } It "Should have Separator as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Separator -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Separator -Type String -Mandatory:$false } It "Should have Value as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Value -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Value -Type String -Mandatory:$false } It "Should have Locale as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Locale -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Locale -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaRegServerStore.Tests.ps1 b/tests/Get-DbaRegServerStore.Tests.ps1 index d1b0d7897d..3932de18e7 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaRegistryRoot.Tests.ps1 b/tests/Get-DbaRegistryRoot.Tests.ps1 index e028efdec7..18b012e29b 100644 --- a/tests/Get-DbaRegistryRoot.Tests.ps1 +++ b/tests/Get-DbaRegistryRoot.Tests.ps1 @@ -6,13 +6,13 @@ Describe "Get-DbaRegistryRoot" { $CommandUnderTest = Get-Command Get-DbaRegistryRoot } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } # Common parameters @('Verbose', 'Debug', 'ErrorVariable', 'WarningVariable', 'InformationVariable', 'OutVariable', 'OutBuffer', 'PipelineVariable') | ForEach-Object { diff --git a/tests/Get-DbaReplArticle.Tests.ps1 b/tests/Get-DbaReplArticle.Tests.ps1 index 6fd0515e1f..07b0262769 100644 --- a/tests/Get-DbaReplArticle.Tests.ps1 +++ b/tests/Get-DbaReplArticle.Tests.ps1 @@ -11,25 +11,25 @@ Describe "Get-DbaReplArticle" { $CommandUnderTest = Get-Command Get-DbaReplArticle } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have Publication as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Publication -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Publication -Type Object[] -Mandatory:$false } It "Should have Schema as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Mandatory:$false } It "Should have Name as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Name -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaReplArticleColumn.Tests.ps1 b/tests/Get-DbaReplArticleColumn.Tests.ps1 index 1179cb5eec..60b11f5214 100644 --- a/tests/Get-DbaReplArticleColumn.Tests.ps1 +++ b/tests/Get-DbaReplArticleColumn.Tests.ps1 @@ -11,25 +11,25 @@ Describe "Get-DbaReplArticleColumn" { $CommandUnderTest = Get-Command Get-DbaReplArticleColumn } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have Publication as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Publication -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Publication -Type Object[] -Mandatory:$false } It "Should have Article as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Article -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Article -Type String[] -Mandatory:$false } It "Should have Column as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Column -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Column -Type String[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaReplDistributor.Tests.ps1 b/tests/Get-DbaReplDistributor.Tests.ps1 index 727716a448..fb59e93413 100644 --- a/tests/Get-DbaReplDistributor.Tests.ps1 +++ b/tests/Get-DbaReplDistributor.Tests.ps1 @@ -6,49 +6,49 @@ Describe "Get-DbaReplDistributor" { $CommandUnderTest = Get-Command Get-DbaReplDistributor } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaReplPublication.Tests.ps1 b/tests/Get-DbaReplPublication.Tests.ps1 index 84f0370c54..33ee04d39e 100644 --- a/tests/Get-DbaReplPublication.Tests.ps1 +++ b/tests/Get-DbaReplPublication.Tests.ps1 @@ -10,22 +10,22 @@ Describe "Get-DbaReplPublication" { $CommandUnderTest = Get-Command Get-DbaReplPublication } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String -Mandatory:$false } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type Object[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaReplServer.Tests.ps1 b/tests/Get-DbaReplServer.Tests.ps1 index 2a0a2cdf46..ee54ba0848 100644 --- a/tests/Get-DbaReplServer.Tests.ps1 +++ b/tests/Get-DbaReplServer.Tests.ps1 @@ -12,49 +12,49 @@ Describe "Get-DbaReplServer" { $CommandUnderTest = Get-Command Get-DbaReplServer } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } } diff --git a/tests/Get-DbaRgClassifierFunction.Tests.ps1 b/tests/Get-DbaRgClassifierFunction.Tests.ps1 index f9e9e219e8..6097716917 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type ResourceGovernor[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type ResourceGovernor[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaRgWorkloadGroup.Tests.ps1 b/tests/Get-DbaRgWorkloadGroup.Tests.ps1 index 5a205347b6..d749b5f3e3 100644 --- a/tests/Get-DbaRgWorkloadGroup.Tests.ps1 +++ b/tests/Get-DbaRgWorkloadGroup.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Get-DbaRgWorkloadGroup" { $CommandUnderTest = Get-Command Get-DbaRgWorkloadGroup } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type ResourcePool[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type ResourcePool[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type ResourcePool[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Get-DbaRunningJob.Tests.ps1 b/tests/Get-DbaRunningJob.Tests.ps1 index b7f9ad1bca..5c128cfa55 100644 --- a/tests/Get-DbaRunningJob.Tests.ps1 +++ b/tests/Get-DbaRunningJob.Tests.ps1 @@ -6,52 +6,52 @@ Describe "Get-DbaRunningJob" { $CommandUnderTest = Get-Command Get-DbaRunningJob } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Job[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Job[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Job[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaSchemaChangeHistory.Tests.ps1 b/tests/Get-DbaSchemaChangeHistory.Tests.ps1 index 805468ce9a..ccad993fb6 100644 --- a/tests/Get-DbaSchemaChangeHistory.Tests.ps1 +++ b/tests/Get-DbaSchemaChangeHistory.Tests.ps1 @@ -6,25 +6,25 @@ Describe "Get-DbaSchemaChangeHistory" { $CommandUnderTest = Get-Command Get-DbaSchemaChangeHistory } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have Since as a non-mandatory parameter of type DbaDateTime" { - $CommandUnderTest | Should -HaveParameter Since -Type DbaDateTime -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Since -Type DbaDateTime -Mandatory:$false } It "Should have Object as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Object -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Object -Type String[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Get-DbaServerRole.Tests.ps1 b/tests/Get-DbaServerRole.Tests.ps1 index 50ad720887..6f475c9215 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have ServerRole parameter" { - $CommandUnderTest | Should -HaveParameter ServerRole -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ServerRole -Type String[] -Mandatory:$false } It "Should have ExcludeServerRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeServerRole -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeServerRole -Type String[] -Mandatory:$false } It "Should have ExcludeFixedRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeFixedRole -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeFixedRole -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaService.Tests.ps1 b/tests/Get-DbaService.Tests.ps1 index 8d0c6810d1..e6393746a4 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have InstanceName as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter InstanceName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InstanceName -Type String[] -Mandatory:$false } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have Type as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Type -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String[] -Mandatory:$false } It "Should have ServiceName as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter ServiceName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ServiceName -Type String[] -Mandatory:$false } It "Should have AdvancedProperties as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter AdvancedProperties -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AdvancedProperties -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaSpConfigure.Tests.ps1 b/tests/Get-DbaSpConfigure.Tests.ps1 index 7862203919..62c03a6399 100644 --- a/tests/Get-DbaSpConfigure.Tests.ps1 +++ b/tests/Get-DbaSpConfigure.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Get-DbaSpConfigure" { $CommandUnderTest = Get-Command Get-DbaSpConfigure } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String[] -Mandatory:$false } It "Should have ExcludeName as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeName -Type String[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaSpinLockStatistic.Tests.ps1 b/tests/Get-DbaSpinLockStatistic.Tests.ps1 index e8d3df1ae5..0ca7668db9 100644 --- a/tests/Get-DbaSpinLockStatistic.Tests.ps1 +++ b/tests/Get-DbaSpinLockStatistic.Tests.ps1 @@ -12,49 +12,49 @@ Describe "Get-DbaSpinLockStatistic" { $CommandUnderTest = Get-Command Get-DbaSpinLockStatistic } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaSpn.Tests.ps1 b/tests/Get-DbaSpn.Tests.ps1 index f6fc7dd9d8..9af93cff3e 100644 --- a/tests/Get-DbaSpn.Tests.ps1 +++ b/tests/Get-DbaSpn.Tests.ps1 @@ -6,52 +6,52 @@ Describe "Get-DbaSpn" { $CommandUnderTest = Get-Command Get-DbaSpn } It "Accepts ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type String[] -Mandatory:$false } It "Accepts AccountName as a parameter" { - $CommandUnderTest | Should -HaveParameter AccountName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AccountName -Type String[] -Mandatory:$false } It "Accepts Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Accepts EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Accepts Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Accepts Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Accepts ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Accepts WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Accepts InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Accepts ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Accepts ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Accepts WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Accepts InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Accepts OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Accepts OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Accepts PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaStartupParameter.Tests.ps1 b/tests/Get-DbaStartupParameter.Tests.ps1 index 490b6abc4c..038bdb38b8 100644 --- a/tests/Get-DbaStartupParameter.Tests.ps1 +++ b/tests/Get-DbaStartupParameter.Tests.ps1 @@ -10,30 +10,30 @@ Describe "Get-DbaStartupParameter" { $CommandUnderTest = Get-Command Get-DbaStartupParameter } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have Simple as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Simple -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Simple -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have common parameters" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaTempdbUsage.Tests.ps1 b/tests/Get-DbaTempdbUsage.Tests.ps1 index e05061544c..5c9b4f5639 100644 --- a/tests/Get-DbaTempdbUsage.Tests.ps1 +++ b/tests/Get-DbaTempdbUsage.Tests.ps1 @@ -12,49 +12,49 @@ Describe "Get-DbaTempdbUsage" { $CommandUnderTest = Get-Command Get-DbaTempdbUsage } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } } diff --git a/tests/Get-DbaTopResourceUsage.Tests.ps1 b/tests/Get-DbaTopResourceUsage.Tests.ps1 index 8f22042c84..1e8366f6d6 100644 --- a/tests/Get-DbaTopResourceUsage.Tests.ps1 +++ b/tests/Get-DbaTopResourceUsage.Tests.ps1 @@ -6,28 +6,28 @@ Describe "Get-DbaTopResourceUsage" { $CommandUnderTest = Get-Command Get-DbaTopResourceUsage } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have Type as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Type -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String[] -Mandatory:$false } It "Should have Limit as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter Limit -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Limit -Type Int32 -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have ExcludeSystem as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystem -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSystem -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaTraceFlag.Tests.ps1 b/tests/Get-DbaTraceFlag.Tests.ps1 index 44dce12cb0..862dbe3a2e 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 DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have TraceFlag as a non-mandatory parameter of type Int32[]" { - $CommandUnderTest | Should -HaveParameter TraceFlag -Type Int32[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter TraceFlag -Type Int32[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaWaitStatistic.Tests.ps1 b/tests/Get-DbaWaitStatistic.Tests.ps1 index b371166b63..6e383ebf41 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Threshold as a parameter" { - $CommandUnderTest | Should -HaveParameter Threshold -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Threshold -Type Int32 -Mandatory:$false } It "Should have IncludeIgnorable as a parameter" { - $CommandUnderTest | Should -HaveParameter IncludeIgnorable -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeIgnorable -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaWsfcAvailableDisk.Tests.ps1 b/tests/Get-DbaWsfcAvailableDisk.Tests.ps1 index a17903ea15..1646c2198c 100644 --- a/tests/Get-DbaWsfcAvailableDisk.Tests.ps1 +++ b/tests/Get-DbaWsfcAvailableDisk.Tests.ps1 @@ -12,49 +12,49 @@ Describe "Get-DbaWsfcAvailableDisk" { $CommandUnderTest = Get-Command Get-DbaWsfcAvailableDisk } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } } diff --git a/tests/Get-DbaWsfcDisk.Tests.ps1 b/tests/Get-DbaWsfcDisk.Tests.ps1 index b313ced845..43633cfc66 100644 --- a/tests/Get-DbaWsfcDisk.Tests.ps1 +++ b/tests/Get-DbaWsfcDisk.Tests.ps1 @@ -12,49 +12,49 @@ Describe "Get-DbaWsfcDisk" { $CommandUnderTest = Get-Command Get-DbaWsfcDisk } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } } diff --git a/tests/Get-DbaWsfcNode.Tests.ps1 b/tests/Get-DbaWsfcNode.Tests.ps1 index a209870039..4b38209e90 100644 --- a/tests/Get-DbaWsfcNode.Tests.ps1 +++ b/tests/Get-DbaWsfcNode.Tests.ps1 @@ -6,49 +6,49 @@ Describe "Get-DbaWsfcNode" { $CommandUnderTest = Get-Command Get-DbaWsfcNode } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaWsfcResource.Tests.ps1 b/tests/Get-DbaWsfcResource.Tests.ps1 index 25b65f1e8e..26bd9aaa1a 100644 --- a/tests/Get-DbaWsfcResource.Tests.ps1 +++ b/tests/Get-DbaWsfcResource.Tests.ps1 @@ -12,49 +12,49 @@ Describe "Get-DbaWsfcResource" { $CommandUnderTest = Get-Command Get-DbaWsfcResource } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-DbaWsfcResourceGroup.Tests.ps1 b/tests/Get-DbaWsfcResourceGroup.Tests.ps1 index da57d589a8..b650e45e28 100644 --- a/tests/Get-DbaWsfcResourceGroup.Tests.ps1 +++ b/tests/Get-DbaWsfcResourceGroup.Tests.ps1 @@ -10,52 +10,52 @@ Describe "Get-DbaWsfcResourceGroup" { $CommandUnderTest = Get-Command Get-DbaWsfcResourceGroup } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have Name as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Name -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } } diff --git a/tests/Get-DbaWsfcResourceType.Tests.ps1 b/tests/Get-DbaWsfcResourceType.Tests.ps1 index 08c30a2148..ec43d2309a 100644 --- a/tests/Get-DbaWsfcResourceType.Tests.ps1 +++ b/tests/Get-DbaWsfcResourceType.Tests.ps1 @@ -6,49 +6,49 @@ Describe "Get-DbaWsfcResourceType" { $CommandUnderTest = Get-Command Get-DbaWsfcResourceType } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } } diff --git a/tests/Get-DbaXESession.Tests.ps1 b/tests/Get-DbaXESession.Tests.ps1 index e302867f58..e1cbcc48dc 100644 --- a/tests/Get-DbaXESession.Tests.ps1 +++ b/tests/Get-DbaXESession.Tests.ps1 @@ -10,16 +10,16 @@ Describe "Get-DbaXESession" { $CommandUnderTest = Get-Command Get-DbaXESession } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Session as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Session -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Session -Type Object[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaXESessionTarget.Tests.ps1 b/tests/Get-DbaXESessionTarget.Tests.ps1 index 5a1c9b8075..be2401a120 100644 --- a/tests/Get-DbaXESessionTarget.Tests.ps1 +++ b/tests/Get-DbaXESessionTarget.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Get-DbaXESessionTarget" { $CommandUnderTest = Get-Command Get-DbaXESessionTarget } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Session as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Session -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Session -Type String[] -Mandatory:$false } It "Should have Target as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Target -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Target -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Session[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Session[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Session[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Get-DbaXESessionTemplate.Tests.ps1 b/tests/Get-DbaXESessionTemplate.Tests.ps1 index 90d045748e..c9cf2cd17d 100644 --- a/tests/Get-DbaXESessionTemplate.Tests.ps1 +++ b/tests/Get-DbaXESessionTemplate.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Get-DbaXESessionTemplate" { $CommandUnderTest = Get-Command Get-DbaXESessionTemplate } It "Should have Path as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String[] -Mandatory:$false } It "Should have Pattern as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Pattern -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Pattern -Type String -Mandatory:$false } It "Should have Template as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Template -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Template -Type String[] -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbaXESmartTarget.Tests.ps1 b/tests/Get-DbaXESmartTarget.Tests.ps1 index 34d372903a..966b192a1d 100644 --- a/tests/Get-DbaXESmartTarget.Tests.ps1 +++ b/tests/Get-DbaXESmartTarget.Tests.ps1 @@ -6,43 +6,43 @@ Describe "Get-DbaXESmartTarget" { $CommandUnderTest = Get-Command Get-DbaXESmartTarget } It "Should have EnableException as a Switch that is not mandatory" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } It "Should have Verbose as a Switch that is not mandatory" { - $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Mandatory:$false } It "Should have Debug as a Switch that is not mandatory" { - $CommandUnderTest | Should -HaveParameter Debug -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type switch -Mandatory:$false } It "Should have ErrorAction as an ActionPreference that is not mandatory" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as an ActionPreference that is not mandatory" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as an ActionPreference that is not mandatory" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as an ActionPreference that is not mandatory" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a String that is not mandatory" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type string -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type string -Mandatory:$false } It "Should have WarningVariable as a String that is not mandatory" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type string -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type string -Mandatory:$false } It "Should have InformationVariable as a String that is not mandatory" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type string -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type string -Mandatory:$false } It "Should have OutVariable as a String that is not mandatory" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type string -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type string -Mandatory:$false } It "Should have OutBuffer as an Int32 that is not mandatory" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type int -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type int -Mandatory:$false } It "Should have PipelineVariable as a String that is not mandatory" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type string -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type string -Mandatory:$false } } } diff --git a/tests/Get-DbaXEStore.Tests.ps1 b/tests/Get-DbaXEStore.Tests.ps1 index b60e4ce7f6..6691ee91db 100644 --- a/tests/Get-DbaXEStore.Tests.ps1 +++ b/tests/Get-DbaXEStore.Tests.ps1 @@ -12,49 +12,49 @@ Describe "Get-DbaXEStore" { $CommandUnderTest = Get-Command Get-DbaXEStore } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } } diff --git a/tests/Get-DbatoolsConfig.Tests.ps1 b/tests/Get-DbatoolsConfig.Tests.ps1 index e567bbdeaa..9f335df623 100644 --- a/tests/Get-DbatoolsConfig.Tests.ps1 +++ b/tests/Get-DbatoolsConfig.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Get-DbatoolsConfig" { $CommandUnderTest = Get-Command Get-DbatoolsConfig } It "Should have parameter FullName of type String" { - $CommandUnderTest | Should -HaveParameter FullName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FullName -Type String -Mandatory:$false } It "Should have parameter Name of type String" { - $CommandUnderTest | Should -HaveParameter Name -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String -Mandatory:$false } It "Should have parameter Module of type String" { - $CommandUnderTest | Should -HaveParameter Module -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Module -Type String -Mandatory:$false } It "Should have parameter Force of type Switch" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DbatoolsLog.Tests.ps1 b/tests/Get-DbatoolsLog.Tests.ps1 index 5282603284..8bac3ce6ac 100644 --- a/tests/Get-DbatoolsLog.Tests.ps1 +++ b/tests/Get-DbatoolsLog.Tests.ps1 @@ -10,37 +10,37 @@ Describe "Get-DbatoolsLog" { $CommandUnderTest = Get-Command Get-DbatoolsLog } It "Should have FunctionName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter FunctionName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FunctionName -Type String -Mandatory:$false } It "Should have ModuleName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ModuleName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ModuleName -Type String -Mandatory:$false } It "Should have Target as a non-mandatory Object parameter" { - $CommandUnderTest | Should -HaveParameter Target -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Target -Type Object -Mandatory:$false } It "Should have Tag as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Tag -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Tag -Type String[] -Mandatory:$false } It "Should have Last as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter Last -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Last -Type Int32 -Mandatory:$false } It "Should have LastError as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter LastError -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LastError -Type Switch -Mandatory:$false } It "Should have Skip as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter Skip -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Skip -Type Int32 -Mandatory:$false } It "Should have Runspace as a non-mandatory Guid parameter" { - $CommandUnderTest | Should -HaveParameter Runspace -Type Guid -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Runspace -Type Guid -Mandatory:$false } It "Should have Level as a non-mandatory MessageLevel[] parameter" { - $CommandUnderTest | Should -HaveParameter Level -Type MessageLevel[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Level -Type MessageLevel[] -Mandatory:$false } It "Should have Raw as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Raw -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Raw -Type Switch -Mandatory:$false } It "Should have Errors as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Errors -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Errors -Type Switch -Mandatory:$false } } diff --git a/tests/Get-DirectoryRestoreFile.Tests.ps1 b/tests/Get-DirectoryRestoreFile.Tests.ps1 index 5c009faad1..27406ac25b 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 String parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have Recurse as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Recurse -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Recurse -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Get-ObjectNameParts.Tests.ps1 b/tests/Get-ObjectNameParts.Tests.ps1 index 2f2603464a..7330594354 100644 --- a/tests/Get-ObjectNameParts.Tests.ps1 +++ b/tests/Get-ObjectNameParts.Tests.ps1 @@ -11,7 +11,7 @@ Describe "Get-ObjectNameParts" { $CommandUnderTest = Get-Command Get-ObjectNameParts } It "Should have ObjectName as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ObjectName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ObjectName -Type String -Mandatory:$false } } diff --git a/tests/Get-SqlDefaultSpConfigure.Tests.ps1 b/tests/Get-SqlDefaultSpConfigure.Tests.ps1 index 5ee6c72817..a377dcce4e 100644 --- a/tests/Get-SqlDefaultSpConfigure.Tests.ps1 +++ b/tests/Get-SqlDefaultSpConfigure.Tests.ps1 @@ -11,43 +11,43 @@ Describe "Get-SqlDefaultSPConfigure" { $CommandUnderTest = Get-Command Get-SqlDefaultSPConfigure } It "Should have SqlVersion as a non-mandatory parameter of type Object" { - $CommandUnderTest | Should -HaveParameter SqlVersion -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlVersion -Type Object -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Get-XpDirTreeRestoreFile.Tests.ps1 b/tests/Get-XpDirTreeRestoreFile.Tests.ps1 index 434667021b..8076e166bb 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 String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have SqlInstance as a non-mandatory DbaInstanceParameter parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter -Mandatory:$false } It "Should have SqlCredential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have NoRecurse as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter NoRecurse -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoRecurse -Type Switch -Mandatory:$false } } diff --git a/tests/Import-DbaCsv.Tests.ps1 b/tests/Import-DbaCsv.Tests.ps1 index f151691d5d..d73d567b46 100644 --- a/tests/Import-DbaCsv.Tests.ps1 +++ b/tests/Import-DbaCsv.Tests.ps1 @@ -22,37 +22,37 @@ Describe "Import-DbaCsv" { $CommandUnderTest = Get-Command Import-DbaCsv } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type Object[] -Mandatory:$false } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String -Mandatory:$false } It "Should have Table parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Table -Type String -Mandatory:$false } It "Should have Schema parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Schema -Type String -Mandatory:$false } It "Should have Truncate parameter" { $CommandUnderTest | Should -HaveParameter Truncate -Type Switch } It "Should have Delimiter parameter" { - $CommandUnderTest | Should -HaveParameter Delimiter -Type Char -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Delimiter -Type Char -Mandatory:$false } It "Should have SingleColumn parameter" { $CommandUnderTest | Should -HaveParameter SingleColumn -Type Switch } It "Should have BatchSize parameter" { - $CommandUnderTest | Should -HaveParameter BatchSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter BatchSize -Type Int32 -Mandatory:$false } It "Should have NotifyAfter parameter" { - $CommandUnderTest | Should -HaveParameter NotifyAfter -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NotifyAfter -Type Int32 -Mandatory:$false } It "Should have TableLock parameter" { $CommandUnderTest | Should -HaveParameter TableLock -Type Switch @@ -70,10 +70,10 @@ Describe "Import-DbaCsv" { $CommandUnderTest | Should -HaveParameter KeepNulls -Type Switch } It "Should have Column parameter" { - $CommandUnderTest | Should -HaveParameter Column -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Column -Type String[] -Mandatory:$false } It "Should have ColumnMap parameter" { - $CommandUnderTest | Should -HaveParameter ColumnMap -Type Hashtable -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ColumnMap -Type Hashtable -Mandatory:$false } It "Should have KeepOrdinalOrder parameter" { $CommandUnderTest | Should -HaveParameter KeepOrdinalOrder -Type Switch @@ -91,31 +91,31 @@ Describe "Import-DbaCsv" { $CommandUnderTest | Should -HaveParameter UseFileNameForSchema -Type Switch } It "Should have Quote parameter" { - $CommandUnderTest | Should -HaveParameter Quote -Type Char -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Quote -Type Char -Mandatory:$false } It "Should have Escape parameter" { - $CommandUnderTest | Should -HaveParameter Escape -Type Char -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Escape -Type Char -Mandatory:$false } It "Should have Comment parameter" { - $CommandUnderTest | Should -HaveParameter Comment -Type Char -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Comment -Type Char -Mandatory:$false } It "Should have TrimmingOption parameter" { - $CommandUnderTest | Should -HaveParameter TrimmingOption -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter TrimmingOption -Type String -Mandatory:$false } It "Should have BufferSize parameter" { - $CommandUnderTest | Should -HaveParameter BufferSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter BufferSize -Type Int32 -Mandatory:$false } It "Should have ParseErrorAction parameter" { - $CommandUnderTest | Should -HaveParameter ParseErrorAction -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ParseErrorAction -Type String -Mandatory:$false } It "Should have Encoding parameter" { - $CommandUnderTest | Should -HaveParameter Encoding -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Encoding -Type String -Mandatory:$false } It "Should have NullValue parameter" { - $CommandUnderTest | Should -HaveParameter NullValue -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NullValue -Type String -Mandatory:$false } It "Should have MaxQuotedFieldLength parameter" { - $CommandUnderTest | Should -HaveParameter MaxQuotedFieldLength -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaxQuotedFieldLength -Type Int32 -Mandatory:$false } It "Should have SkipEmptyLine parameter" { $CommandUnderTest | Should -HaveParameter SkipEmptyLine -Type Switch diff --git a/tests/Import-DbaRegServer.Tests.ps1 b/tests/Import-DbaRegServer.Tests.ps1 index 536fb7807d..afc005d4cf 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Path parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String[] -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have Group parameter" { - $CommandUnderTest | Should -HaveParameter Group -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Group -Type Object -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Import-DbatoolsConfig.Tests.ps1 b/tests/Import-DbatoolsConfig.Tests.ps1 index 83f6a3f6e3..be250f4a83 100644 --- a/tests/Import-DbatoolsConfig.Tests.ps1 +++ b/tests/Import-DbatoolsConfig.Tests.ps1 @@ -12,28 +12,28 @@ Describe "Import-DbatoolsConfig" { $CommandUnderTest = Get-Command Import-DbatoolsConfig } It "Should have Path as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String[] -Mandatory:$false } It "Should have ModuleName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ModuleName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ModuleName -Type String -Mandatory:$false } It "Should have ModuleVersion as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter ModuleVersion -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ModuleVersion -Type Int32 -Mandatory:$false } It "Should have Scope as a non-mandatory ConfigScope parameter" { - $CommandUnderTest | Should -HaveParameter Scope -Type ConfigScope -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Scope -Type ConfigScope -Mandatory:$false } It "Should have IncludeFilter as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter IncludeFilter -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeFilter -Type String[] -Mandatory:$false } It "Should have ExcludeFilter as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeFilter -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeFilter -Type String[] -Mandatory:$false } It "Should have Peek as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Peek -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Peek -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Install-DbaInstance.Tests.ps1 b/tests/Install-DbaInstance.Tests.ps1 index 99a6753067..e52e65dfae 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 DbaInstanceParameter[] -Not -Mandatory + $command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Version parameter" { - $command | Should -HaveParameter Version -Type String -Not -Mandatory + $command | Should -HaveParameter Version -Type String -Mandatory:$false } It "Should have InstanceName parameter" { - $command | Should -HaveParameter InstanceName -Type String -Not -Mandatory + $command | Should -HaveParameter InstanceName -Type String -Mandatory:$false } It "Should have SaCredential parameter" { - $command | Should -HaveParameter SaCredential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter SaCredential -Type PSCredential -Mandatory:$false } It "Should have Credential parameter" { - $command | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have Authentication parameter" { - $command | Should -HaveParameter Authentication -Type String -Not -Mandatory + $command | Should -HaveParameter Authentication -Type String -Mandatory:$false } It "Should have ConfigurationFile parameter" { - $command | Should -HaveParameter ConfigurationFile -Type Object -Not -Mandatory + $command | Should -HaveParameter ConfigurationFile -Type Object -Mandatory:$false } It "Should have Configuration parameter" { - $command | Should -HaveParameter Configuration -Type Hashtable -Not -Mandatory + $command | Should -HaveParameter Configuration -Type Hashtable -Mandatory:$false } It "Should have Path parameter" { - $command | Should -HaveParameter Path -Type String[] -Not -Mandatory + $command | Should -HaveParameter Path -Type String[] -Mandatory:$false } It "Should have Feature parameter" { - $command | Should -HaveParameter Feature -Type String[] -Not -Mandatory + $command | Should -HaveParameter Feature -Type String[] -Mandatory:$false } It "Should have AuthenticationMode parameter" { - $command | Should -HaveParameter AuthenticationMode -Type String -Not -Mandatory + $command | Should -HaveParameter AuthenticationMode -Type String -Mandatory:$false } It "Should have InstancePath parameter" { - $command | Should -HaveParameter InstancePath -Type String -Not -Mandatory + $command | Should -HaveParameter InstancePath -Type String -Mandatory:$false } It "Should have DataPath parameter" { - $command | Should -HaveParameter DataPath -Type String -Not -Mandatory + $command | Should -HaveParameter DataPath -Type String -Mandatory:$false } It "Should have LogPath parameter" { - $command | Should -HaveParameter LogPath -Type String -Not -Mandatory + $command | Should -HaveParameter LogPath -Type String -Mandatory:$false } It "Should have TempPath parameter" { - $command | Should -HaveParameter TempPath -Type String -Not -Mandatory + $command | Should -HaveParameter TempPath -Type String -Mandatory:$false } It "Should have BackupPath parameter" { - $command | Should -HaveParameter BackupPath -Type String -Not -Mandatory + $command | Should -HaveParameter BackupPath -Type String -Mandatory:$false } It "Should have UpdateSourcePath parameter" { - $command | Should -HaveParameter UpdateSourcePath -Type String -Not -Mandatory + $command | Should -HaveParameter UpdateSourcePath -Type String -Mandatory:$false } It "Should have AdminAccount parameter" { - $command | Should -HaveParameter AdminAccount -Type String[] -Not -Mandatory + $command | Should -HaveParameter AdminAccount -Type String[] -Mandatory:$false } It "Should have Port parameter" { - $command | Should -HaveParameter Port -Type Int32 -Not -Mandatory + $command | Should -HaveParameter Port -Type Int32 -Mandatory:$false } It "Should have Throttle parameter" { - $command | Should -HaveParameter Throttle -Type Int32 -Not -Mandatory + $command | Should -HaveParameter Throttle -Type Int32 -Mandatory:$false } It "Should have ProductID parameter" { - $command | Should -HaveParameter ProductID -Type String -Not -Mandatory + $command | Should -HaveParameter ProductID -Type String -Mandatory:$false } It "Should have AsCollation parameter" { - $command | Should -HaveParameter AsCollation -Type String -Not -Mandatory + $command | Should -HaveParameter AsCollation -Type String -Mandatory:$false } It "Should have SqlCollation parameter" { - $command | Should -HaveParameter SqlCollation -Type String -Not -Mandatory + $command | Should -HaveParameter SqlCollation -Type String -Mandatory:$false } It "Should have EngineCredential parameter" { - $command | Should -HaveParameter EngineCredential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter EngineCredential -Type PSCredential -Mandatory:$false } It "Should have AgentCredential parameter" { - $command | Should -HaveParameter AgentCredential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter AgentCredential -Type PSCredential -Mandatory:$false } It "Should have ASCredential parameter" { - $command | Should -HaveParameter ASCredential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter ASCredential -Type PSCredential -Mandatory:$false } It "Should have ISCredential parameter" { - $command | Should -HaveParameter ISCredential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter ISCredential -Type PSCredential -Mandatory:$false } It "Should have RSCredential parameter" { - $command | Should -HaveParameter RSCredential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter RSCredential -Type PSCredential -Mandatory:$false } It "Should have FTCredential parameter" { - $command | Should -HaveParameter FTCredential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter FTCredential -Type PSCredential -Mandatory:$false } It "Should have PBEngineCredential parameter" { - $command | Should -HaveParameter PBEngineCredential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter PBEngineCredential -Type PSCredential -Mandatory:$false } It "Should have SaveConfiguration parameter" { - $command | Should -HaveParameter SaveConfiguration -Type String -Not -Mandatory + $command | Should -HaveParameter SaveConfiguration -Type String -Mandatory:$false } It "Should have PerformVolumeMaintenanceTasks parameter" { - $command | Should -HaveParameter PerformVolumeMaintenanceTasks -Type Switch -Not -Mandatory + $command | Should -HaveParameter PerformVolumeMaintenanceTasks -Type Switch -Mandatory:$false } It "Should have Restart parameter" { - $command | Should -HaveParameter Restart -Type Switch -Not -Mandatory + $command | Should -HaveParameter Restart -Type Switch -Mandatory:$false } It "Should have NoPendingRenameCheck parameter" { - $command | Should -HaveParameter NoPendingRenameCheck -Type Switch -Not -Mandatory + $command | Should -HaveParameter NoPendingRenameCheck -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $command | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Invoke-DbaAdvancedInstall.Tests.ps1 b/tests/Invoke-DbaAdvancedInstall.Tests.ps1 index 0b0bdf1ec7..fff0fbe725 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 String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type String -Mandatory:$false } It "Should have InstanceName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter InstanceName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InstanceName -Type String -Mandatory:$false } It "Should have Port as a non-mandatory Nullable`1 parameter" { - $CommandUnderTest | Should -HaveParameter Port -Type ([Nullable`1]) -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Port -Type ([Nullable`1]) -Mandatory:$false } It "Should have InstallationPath as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter InstallationPath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InstallationPath -Type String -Mandatory:$false } It "Should have ConfigurationPath as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ConfigurationPath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ConfigurationPath -Type String -Mandatory:$false } It "Should have ArgumentList as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter ArgumentList -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ArgumentList -Type String[] -Mandatory:$false } It "Should have Version as a non-mandatory Version parameter" { - $CommandUnderTest | Should -HaveParameter Version -Type Version -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Version -Type Version -Mandatory:$false } It "Should have Configuration as a non-mandatory Hashtable parameter" { - $CommandUnderTest | Should -HaveParameter Configuration -Type Hashtable -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Configuration -Type Hashtable -Mandatory:$false } It "Should have Restart as a non-mandatory Boolean parameter" { - $CommandUnderTest | Should -HaveParameter Restart -Type Boolean -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Restart -Type Boolean -Mandatory:$false } It "Should have PerformVolumeMaintenanceTasks as a non-mandatory Boolean parameter" { - $CommandUnderTest | Should -HaveParameter PerformVolumeMaintenanceTasks -Type Boolean -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PerformVolumeMaintenanceTasks -Type Boolean -Mandatory:$false } It "Should have SaveConfiguration as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter SaveConfiguration -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SaveConfiguration -Type String -Mandatory:$false } It "Should have Authentication as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Authentication -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Authentication -Type String -Mandatory:$false } It "Should have Credential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have SaCredential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter SaCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SaCredential -Type PSCredential -Mandatory:$false } It "Should have NoPendingRenameCheck as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter NoPendingRenameCheck -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoPendingRenameCheck -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Invoke-DbaAdvancedUpdate.Tests.ps1 b/tests/Invoke-DbaAdvancedUpdate.Tests.ps1 index a4f8052ddf..a463d0c656 100644 --- a/tests/Invoke-DbaAdvancedUpdate.Tests.ps1 +++ b/tests/Invoke-DbaAdvancedUpdate.Tests.ps1 @@ -27,31 +27,31 @@ Describe "Invoke-DbaAdvancedUpdate" { $CommandUnderTest = Get-Command Invoke-DbaAdvancedUpdate } It "Should have ComputerName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type String -Mandatory:$false } It "Should have Action as a non-mandatory Object[] parameter" { - $CommandUnderTest | Should -HaveParameter Action -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Action -Type Object[] -Mandatory:$false } It "Should have Restart as a non-mandatory Boolean parameter" { - $CommandUnderTest | Should -HaveParameter Restart -Type Boolean -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Restart -Type Boolean -Mandatory:$false } It "Should have Authentication as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Authentication -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Authentication -Type String -Mandatory:$false } It "Should have Credential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have ExtractPath as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ExtractPath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExtractPath -Type String -Mandatory:$false } It "Should have ArgumentList as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter ArgumentList -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ArgumentList -Type String[] -Mandatory:$false } It "Should have NoPendingRenameCheck as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter NoPendingRenameCheck -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoPendingRenameCheck -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Invoke-DbaAgFailover.Tests.ps1 b/tests/Invoke-DbaAgFailover.Tests.ps1 index 6ae90c1f01..cf1c0544f7 100644 --- a/tests/Invoke-DbaAgFailover.Tests.ps1 +++ b/tests/Invoke-DbaAgFailover.Tests.ps1 @@ -10,38 +10,38 @@ Describe "Invoke-DbaAgFailover" { $CommandUnderTest = Get-Command Invoke-DbaAgFailover } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have AvailabilityGroup parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String[] -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type AvailabilityGroup[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type AvailabilityGroup[] -Mandatory:$false } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have common parameters" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } diff --git a/tests/Invoke-DbaBalanceDataFiles.Tests.ps1 b/tests/Invoke-DbaBalanceDataFiles.Tests.ps1 index 28a7031d0b..458fa4b122 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have Table parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Table -Type Object[] -Mandatory:$false } It "Should have RebuildOffline parameter" { - $CommandUnderTest | Should -HaveParameter RebuildOffline -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RebuildOffline -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } } } diff --git a/tests/Invoke-DbaCycleErrorLog.Tests.ps1 b/tests/Invoke-DbaCycleErrorLog.Tests.ps1 index 28123a1dc4..7a3932fe03 100644 --- a/tests/Invoke-DbaCycleErrorLog.Tests.ps1 +++ b/tests/Invoke-DbaCycleErrorLog.Tests.ps1 @@ -13,35 +13,35 @@ Describe "Invoke-DbaCycleErrorLog Unit Tests" -Tag "UnitTests" { } It "Should have SqlInstance parameter" { - $command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $command | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Type parameter" { - $command | Should -HaveParameter Type -Type String -Not -Mandatory + $command | Should -HaveParameter Type -Type String -Mandatory:$false } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $command | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have common parameters" { - $command | Should -HaveParameter Verbose -Type Switch -Not -Mandatory - $command | Should -HaveParameter Debug -Type Switch -Not -Mandatory - $command | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory - $command | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory - $command | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory - $command | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory - $command | Should -HaveParameter WarningVariable -Type String -Not -Mandatory - $command | Should -HaveParameter InformationVariable -Type String -Not -Mandatory - $command | Should -HaveParameter OutVariable -Type String -Not -Mandatory - $command | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory - $command | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory - $command | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory - $command | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $command | Should -HaveParameter Verbose -Type Switch -Mandatory:$false + $command | Should -HaveParameter Debug -Type Switch -Mandatory:$false + $command | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false + $command | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false + $command | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false + $command | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false + $command | Should -HaveParameter WarningVariable -Type String -Mandatory:$false + $command | Should -HaveParameter InformationVariable -Type String -Mandatory:$false + $command | Should -HaveParameter OutVariable -Type String -Mandatory:$false + $command | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false + $command | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false + $command | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false + $command | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } } diff --git a/tests/Invoke-DbaDbClone.Tests.ps1 b/tests/Invoke-DbaDbClone.Tests.ps1 index 23c4e455b1..e7d5715f6c 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have CloneDatabase parameter" { - $CommandUnderTest | Should -HaveParameter CloneDatabase -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CloneDatabase -Type String[] -Mandatory:$false } It "Should have ExcludeStatistics parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeStatistics -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeStatistics -Type Switch -Mandatory:$false } It "Should have ExcludeQueryStore parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeQueryStore -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeQueryStore -Type Switch -Mandatory:$false } It "Should have UpdateStatistics parameter" { - $CommandUnderTest | Should -HaveParameter UpdateStatistics -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter UpdateStatistics -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Invoke-DbaDbDataGenerator.Tests.ps1 b/tests/Invoke-DbaDbDataGenerator.Tests.ps1 index 3e7d7288d1..3fcff4461e 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have FilePath parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilePath -Type Object -Mandatory:$false } It "Should have Locale parameter" { - $CommandUnderTest | Should -HaveParameter Locale -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Locale -Type String -Mandatory:$false } It "Should have CharacterString parameter" { - $CommandUnderTest | Should -HaveParameter CharacterString -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CharacterString -Type String -Mandatory:$false } It "Should have Table parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Table -Type String[] -Mandatory:$false } It "Should have Column parameter" { - $CommandUnderTest | Should -HaveParameter Column -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Column -Type String[] -Mandatory:$false } It "Should have ExcludeTable parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeTable -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeTable -Type String[] -Mandatory:$false } It "Should have ExcludeColumn parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeColumn -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeColumn -Type String[] -Mandatory:$false } It "Should have MaxValue parameter" { - $CommandUnderTest | Should -HaveParameter MaxValue -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaxValue -Type Int32 -Mandatory:$false } It "Should have ExactLength parameter" { - $CommandUnderTest | Should -HaveParameter ExactLength -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExactLength -Type Switch -Mandatory:$false } It "Should have ModulusFactor parameter" { - $CommandUnderTest | Should -HaveParameter ModulusFactor -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ModulusFactor -Type Int32 -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Invoke-DbaDbDbccCheckConstraint.Tests.ps1 b/tests/Invoke-DbaDbDbccCheckConstraint.Tests.ps1 index d96154e045..bb2385d8ae 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have Object parameter" { - $CommandUnderTest | Should -HaveParameter Object -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Object -Type String -Mandatory:$false } It "Should have AllConstraints parameter" { - $CommandUnderTest | Should -HaveParameter AllConstraints -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AllConstraints -Type Switch -Mandatory:$false } It "Should have AllErrorMessages parameter" { - $CommandUnderTest | Should -HaveParameter AllErrorMessages -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AllErrorMessages -Type Switch -Mandatory:$false } It "Should have NoInformationalMessages parameter" { - $CommandUnderTest | Should -HaveParameter NoInformationalMessages -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoInformationalMessages -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Invoke-DbaDbDbccCleanTable.Tests.ps1 b/tests/Invoke-DbaDbDbccCleanTable.Tests.ps1 index 229b50b130..e2f80fa532 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have Object parameter" { - $CommandUnderTest | Should -HaveParameter Object -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Object -Type String[] -Mandatory:$false } It "Should have BatchSize parameter" { - $CommandUnderTest | Should -HaveParameter BatchSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter BatchSize -Type Int32 -Mandatory:$false } It "Should have NoInformationalMessages parameter" { - $CommandUnderTest | Should -HaveParameter NoInformationalMessages -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoInformationalMessages -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Invoke-DbaDbDecryptObject.Tests.ps1 b/tests/Invoke-DbaDbDecryptObject.Tests.ps1 index e8aea43edd..24a53bdf3e 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 DbaInstanceParameter -Not -Mandatory + $command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter -Mandatory:$false } It "Should have SqlCredential parameter" { - $command | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $command | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $command | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ObjectName parameter" { - $command | Should -HaveParameter ObjectName -Type String[] -Not -Mandatory + $command | Should -HaveParameter ObjectName -Type String[] -Mandatory:$false } It "Should have EncodingType parameter" { - $command | Should -HaveParameter EncodingType -Type String -Not -Mandatory + $command | Should -HaveParameter EncodingType -Type String -Mandatory:$false } It "Should have ExportDestination parameter" { - $command | Should -HaveParameter ExportDestination -Type String -Not -Mandatory + $command | Should -HaveParameter ExportDestination -Type String -Mandatory:$false } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $command | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Invoke-DbaDbMirrorFailover.Tests.ps1 b/tests/Invoke-DbaDbMirrorFailover.Tests.ps1 index 16de0d436a..1b9a19cd7d 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 DbaInstanceParameter -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have Force as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Invoke-DbaDbPiiScan.Tests.ps1 b/tests/Invoke-DbaDbPiiScan.Tests.ps1 index 440786c83e..586349bd74 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have Table as a parameter" { - $CommandUnderTest | Should -HaveParameter Table -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Table -Type String[] -Mandatory:$false } It "Should have Column as a parameter" { - $CommandUnderTest | Should -HaveParameter Column -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Column -Type String[] -Mandatory:$false } It "Should have Country as a parameter" { - $CommandUnderTest | Should -HaveParameter Country -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Country -Type String[] -Mandatory:$false } It "Should have CountryCode as a parameter" { - $CommandUnderTest | Should -HaveParameter CountryCode -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CountryCode -Type String[] -Mandatory:$false } It "Should have ExcludeTable as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeTable -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeTable -Type String[] -Mandatory:$false } It "Should have ExcludeColumn as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeColumn -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeColumn -Type String[] -Mandatory:$false } It "Should have SampleCount as a parameter" { - $CommandUnderTest | Should -HaveParameter SampleCount -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SampleCount -Type Int32 -Mandatory:$false } It "Should have KnownNameFilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter KnownNameFilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter KnownNameFilePath -Type String -Mandatory:$false } It "Should have PatternFilePath as a parameter" { - $CommandUnderTest | Should -HaveParameter PatternFilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PatternFilePath -Type String -Mandatory:$false } It "Should have ExcludeDefaultKnownName as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDefaultKnownName -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDefaultKnownName -Type Switch -Mandatory:$false } It "Should have ExcludeDefaultPattern as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDefaultPattern -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDefaultPattern -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Invoke-DbaDbShrink.Tests.ps1 b/tests/Invoke-DbaDbShrink.Tests.ps1 index 39fab2b5fd..ff2fcd678a 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have AllUserDatabases parameter" { - $CommandUnderTest | Should -HaveParameter AllUserDatabases -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AllUserDatabases -Type Switch -Mandatory:$false } It "Should have PercentFreeSpace parameter" { - $CommandUnderTest | Should -HaveParameter PercentFreeSpace -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PercentFreeSpace -Type Int32 -Mandatory:$false } It "Should have ShrinkMethod parameter" { - $CommandUnderTest | Should -HaveParameter ShrinkMethod -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ShrinkMethod -Type String -Mandatory:$false } It "Should have FileType parameter" { - $CommandUnderTest | Should -HaveParameter FileType -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FileType -Type String -Mandatory:$false } It "Should have StepSize parameter" { - $CommandUnderTest | Should -HaveParameter StepSize -Type Int64 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter StepSize -Type Int64 -Mandatory:$false } It "Should have StatementTimeout parameter" { - $CommandUnderTest | Should -HaveParameter StatementTimeout -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter StatementTimeout -Type Int32 -Mandatory:$false } It "Should have ExcludeIndexStats parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeIndexStats -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeIndexStats -Type Switch -Mandatory:$false } It "Should have ExcludeUpdateUsage parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeUpdateUsage -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeUpdateUsage -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Invoke-DbaDbUpgrade.Tests.ps1 b/tests/Invoke-DbaDbUpgrade.Tests.ps1 index 452525cebc..fd571fa659 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have NoCheckDb parameter" { - $CommandUnderTest | Should -HaveParameter NoCheckDb -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoCheckDb -Type Switch -Mandatory:$false } It "Should have NoUpdateUsage parameter" { - $CommandUnderTest | Should -HaveParameter NoUpdateUsage -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoUpdateUsage -Type Switch -Mandatory:$false } It "Should have NoUpdateStats parameter" { - $CommandUnderTest | Should -HaveParameter NoUpdateStats -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoUpdateStats -Type Switch -Mandatory:$false } It "Should have NoRefreshView parameter" { - $CommandUnderTest | Should -HaveParameter NoRefreshView -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoRefreshView -Type Switch -Mandatory:$false } It "Should have AllUserDatabases parameter" { - $CommandUnderTest | Should -HaveParameter AllUserDatabases -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AllUserDatabases -Type Switch -Mandatory:$false } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Invoke-DbaPfRelog.Tests.ps1 b/tests/Invoke-DbaPfRelog.Tests.ps1 index 7e9986a491..af0d87a42d 100644 --- a/tests/Invoke-DbaPfRelog.Tests.ps1 +++ b/tests/Invoke-DbaPfRelog.Tests.ps1 @@ -12,55 +12,55 @@ Describe "Invoke-DbaPfRelog Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Invoke-DbaPfRelog } It "Should have Path as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String[] -Mandatory:$false } It "Should have Destination as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Destination -Type String -Mandatory:$false } It "Should have Type as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String -Mandatory:$false } It "Should have Append as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Append -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Append -Type Switch -Mandatory:$false } It "Should have AllowClobber as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter AllowClobber -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AllowClobber -Type Switch -Mandatory:$false } It "Should have PerformanceCounter as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter PerformanceCounter -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PerformanceCounter -Type String[] -Mandatory:$false } It "Should have PerformanceCounterPath as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter PerformanceCounterPath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PerformanceCounterPath -Type String -Mandatory:$false } It "Should have Interval as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter Interval -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Interval -Type Int32 -Mandatory:$false } It "Should have BeginTime as a non-mandatory DateTime parameter" { - $CommandUnderTest | Should -HaveParameter BeginTime -Type DateTime -Not -Mandatory + $CommandUnderTest | Should -HaveParameter BeginTime -Type DateTime -Mandatory:$false } It "Should have EndTime as a non-mandatory DateTime parameter" { - $CommandUnderTest | Should -HaveParameter EndTime -Type DateTime -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EndTime -Type DateTime -Mandatory:$false } It "Should have ConfigPath as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ConfigPath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ConfigPath -Type String -Mandatory:$false } It "Should have Summary as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Summary -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Summary -Type Switch -Mandatory:$false } It "Should have InputObject as a non-mandatory Object[] parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have Multithread as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Multithread -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Multithread -Type Switch -Mandatory:$false } It "Should have AllTime as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter AllTime -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AllTime -Type Switch -Mandatory:$false } It "Should have Raw as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Raw -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Raw -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Invoke-DbaQuery.Tests.ps1 b/tests/Invoke-DbaQuery.Tests.ps1 index 69e9cd6827..3b2f5f7213 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String -Mandatory:$false } It "Should have Query parameter" { - $CommandUnderTest | Should -HaveParameter Query -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Query -Type String -Mandatory:$false } It "Should have QueryTimeout parameter" { - $CommandUnderTest | Should -HaveParameter QueryTimeout -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter QueryTimeout -Type Int32 -Mandatory:$false } It "Should have File parameter" { - $CommandUnderTest | Should -HaveParameter File -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter File -Type Object[] -Mandatory:$false } It "Should have SqlObject parameter" { - $CommandUnderTest | Should -HaveParameter SqlObject -Type SqlSmoObject[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlObject -Type SqlSmoObject[] -Mandatory:$false } It "Should have As parameter" { - $CommandUnderTest | Should -HaveParameter As -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter As -Type String -Mandatory:$false } It "Should have SqlParameter parameter" { - $CommandUnderTest | Should -HaveParameter SqlParameter -Type PSObject[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlParameter -Type PSObject[] -Mandatory:$false } It "Should have CommandType parameter" { - $CommandUnderTest | Should -HaveParameter CommandType -Type CommandType -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CommandType -Type CommandType -Mandatory:$false } It "Should have AppendServerInstance parameter" { - $CommandUnderTest | Should -HaveParameter AppendServerInstance -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AppendServerInstance -Type Switch -Mandatory:$false } It "Should have MessagesToOutput parameter" { - $CommandUnderTest | Should -HaveParameter MessagesToOutput -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MessagesToOutput -Type Switch -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have ReadOnly parameter" { - $CommandUnderTest | Should -HaveParameter ReadOnly -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ReadOnly -Type Switch -Mandatory:$false } It "Should have NoExec parameter" { - $CommandUnderTest | Should -HaveParameter NoExec -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoExec -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Invoke-DbatoolsFormatter.Tests.ps1 b/tests/Invoke-DbatoolsFormatter.Tests.ps1 index 3db2ead224..b5ed185a91 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 Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type Object[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Invoke-DbatoolsRenameHelper.Tests.ps1 b/tests/Invoke-DbatoolsRenameHelper.Tests.ps1 index a2da6e4720..c701c7cbef 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 FileInfo[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type FileInfo[] -Mandatory:$false } It "Should have Encoding as a parameter" { - $CommandUnderTest | Should -HaveParameter Encoding -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Encoding -Type String -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Join-DbaPath.Tests.ps1 b/tests/Join-DbaPath.Tests.ps1 index d2496a37a4..a807673bbb 100644 --- a/tests/Join-DbaPath.Tests.ps1 +++ b/tests/Join-DbaPath.Tests.ps1 @@ -10,49 +10,49 @@ Describe "Join-DbaPath" { $CommandUnderTest = Get-Command Join-DbaPath } It "Should have Path as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have SqlInstance as a non-mandatory DbaInstanceParameter parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter -Mandatory:$false } It "Should have Child as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Child -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Child -Type String[] -Mandatory:$false } It "Should have Verbose as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory ActionPreference parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory ActionPreference parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory ActionPreference parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory ActionPreference parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Measure-DbaBackupThroughput.Tests.ps1 b/tests/Measure-DbaBackupThroughput.Tests.ps1 index eff57981de..5e8d3c1cfb 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have Since parameter" { - $CommandUnderTest | Should -HaveParameter Since -Type DateTime -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Since -Type DateTime -Mandatory:$false } It "Should have Last parameter" { - $CommandUnderTest | Should -HaveParameter Last -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Last -Type Switch -Mandatory:$false } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String -Mandatory:$false } It "Should have DeviceType parameter" { - $CommandUnderTest | Should -HaveParameter DeviceType -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DeviceType -Type String[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Measure-DbaDbVirtualLogFile.Tests.ps1 b/tests/Measure-DbaDbVirtualLogFile.Tests.ps1 index 15b2727a64..b4d77131b4 100644 --- a/tests/Measure-DbaDbVirtualLogFile.Tests.ps1 +++ b/tests/Measure-DbaDbVirtualLogFile.Tests.ps1 @@ -11,22 +11,22 @@ Describe "Measure-DbaDbVirtualLogFile" { $CommandUnderTest = Get-Command Measure-DbaDbVirtualLogFile } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have IncludeSystemDBs as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemDBs -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeSystemDBs -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaAgentAlert.Tests.ps1 b/tests/New-DbaAgentAlert.Tests.ps1 index c0cad484eb..18df17d067 100644 --- a/tests/New-DbaAgentAlert.Tests.ps1 +++ b/tests/New-DbaAgentAlert.Tests.ps1 @@ -10,61 +10,61 @@ Describe "New-DbaAgentAlert" { $CommandUnderTest = Get-Command New-DbaAgentAlert } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Alert parameter" { - $CommandUnderTest | Should -HaveParameter Alert -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Alert -Type String -Mandatory:$false } It "Should have Category parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Category -Type String -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String -Mandatory:$false } It "Should have Operator parameter" { - $CommandUnderTest | Should -HaveParameter Operator -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Operator -Type String[] -Mandatory:$false } It "Should have DelayBetweenResponses parameter" { - $CommandUnderTest | Should -HaveParameter DelayBetweenResponses -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DelayBetweenResponses -Type Int32 -Mandatory:$false } It "Should have Disabled parameter" { - $CommandUnderTest | Should -HaveParameter Disabled -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Disabled -Type Switch -Mandatory:$false } It "Should have EventDescriptionKeyword parameter" { - $CommandUnderTest | Should -HaveParameter EventDescriptionKeyword -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EventDescriptionKeyword -Type String -Mandatory:$false } It "Should have EventSource parameter" { - $CommandUnderTest | Should -HaveParameter EventSource -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EventSource -Type String -Mandatory:$false } It "Should have JobId parameter" { - $CommandUnderTest | Should -HaveParameter JobId -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter JobId -Type String -Mandatory:$false } It "Should have Severity parameter" { - $CommandUnderTest | Should -HaveParameter Severity -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Severity -Type Int32 -Mandatory:$false } It "Should have MessageId parameter" { - $CommandUnderTest | Should -HaveParameter MessageId -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MessageId -Type Int32 -Mandatory:$false } It "Should have NotificationMessage parameter" { - $CommandUnderTest | Should -HaveParameter NotificationMessage -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NotificationMessage -Type String -Mandatory:$false } It "Should have PerformanceCondition parameter" { - $CommandUnderTest | Should -HaveParameter PerformanceCondition -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PerformanceCondition -Type String -Mandatory:$false } It "Should have WmiEventNamespace parameter" { - $CommandUnderTest | Should -HaveParameter WmiEventNamespace -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WmiEventNamespace -Type String -Mandatory:$false } It "Should have WmiEventQuery parameter" { - $CommandUnderTest | Should -HaveParameter WmiEventQuery -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WmiEventQuery -Type String -Mandatory:$false } It "Should have NotifyMethod parameter" { - $CommandUnderTest | Should -HaveParameter NotifyMethod -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NotifyMethod -Type String -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaAgentAlertCategory.Tests.ps1 b/tests/New-DbaAgentAlertCategory.Tests.ps1 index fd4e8314b5..cf34c43ea0 100644 --- a/tests/New-DbaAgentAlertCategory.Tests.ps1 +++ b/tests/New-DbaAgentAlertCategory.Tests.ps1 @@ -10,19 +10,19 @@ Describe "New-DbaAgentAlertCategory" { $CommandUnderTest = Get-Command New-DbaAgentAlertCategory } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Category as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Category -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Category -Type String[] -Mandatory:$false } It "Should have Force as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaAgentJob.Tests.ps1 b/tests/New-DbaAgentJob.Tests.ps1 index 54d87509b0..7b3e6c4376 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Job parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Job -Type String -Mandatory:$false } It "Should have Schedule parameter" { - $CommandUnderTest | Should -HaveParameter Schedule -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Schedule -Type Object[] -Mandatory:$false } It "Should have ScheduleId parameter" { - $CommandUnderTest | Should -HaveParameter ScheduleId -Type Int32[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ScheduleId -Type Int32[] -Mandatory:$false } It "Should have Disabled parameter" { - $CommandUnderTest | Should -HaveParameter Disabled -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Disabled -Type Switch -Mandatory:$false } It "Should have Description parameter" { - $CommandUnderTest | Should -HaveParameter Description -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Description -Type String -Mandatory:$false } It "Should have StartStepId parameter" { - $CommandUnderTest | Should -HaveParameter StartStepId -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter StartStepId -Type Int32 -Mandatory:$false } It "Should have Category parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Category -Type String -Mandatory:$false } It "Should have OwnerLogin parameter" { - $CommandUnderTest | Should -HaveParameter OwnerLogin -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OwnerLogin -Type String -Mandatory:$false } It "Should have EventLogLevel parameter" { - $CommandUnderTest | Should -HaveParameter EventLogLevel -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EventLogLevel -Type Object -Mandatory:$false } It "Should have EmailLevel parameter" { - $CommandUnderTest | Should -HaveParameter EmailLevel -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EmailLevel -Type Object -Mandatory:$false } It "Should have PageLevel parameter" { - $CommandUnderTest | Should -HaveParameter PageLevel -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PageLevel -Type Object -Mandatory:$false } It "Should have EmailOperator parameter" { - $CommandUnderTest | Should -HaveParameter EmailOperator -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EmailOperator -Type String -Mandatory:$false } It "Should have NetsendOperator parameter" { - $CommandUnderTest | Should -HaveParameter NetsendOperator -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NetsendOperator -Type String -Mandatory:$false } It "Should have PageOperator parameter" { - $CommandUnderTest | Should -HaveParameter PageOperator -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PageOperator -Type String -Mandatory:$false } It "Should have DeleteLevel parameter" { - $CommandUnderTest | Should -HaveParameter DeleteLevel -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DeleteLevel -Type Object -Mandatory:$false } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaAgentSchedule.Tests.ps1 b/tests/New-DbaAgentSchedule.Tests.ps1 index 0d3edf64cc..cc1b732784 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Job as a parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Job -Type Object[] -Mandatory:$false } It "Should have Schedule as a parameter" { - $CommandUnderTest | Should -HaveParameter Schedule -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Schedule -Type Object -Mandatory:$false } It "Should have Disabled as a parameter" { - $CommandUnderTest | Should -HaveParameter Disabled -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Disabled -Type Switch -Mandatory:$false } It "Should have FrequencyType as a parameter" { - $CommandUnderTest | Should -HaveParameter FrequencyType -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FrequencyType -Type Object -Mandatory:$false } It "Should have FrequencyInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter FrequencyInterval -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FrequencyInterval -Type Object[] -Mandatory:$false } It "Should have FrequencySubdayType as a parameter" { - $CommandUnderTest | Should -HaveParameter FrequencySubdayType -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FrequencySubdayType -Type Object -Mandatory:$false } It "Should have FrequencySubdayInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter FrequencySubdayInterval -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FrequencySubdayInterval -Type Int32 -Mandatory:$false } It "Should have FrequencyRelativeInterval as a parameter" { - $CommandUnderTest | Should -HaveParameter FrequencyRelativeInterval -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FrequencyRelativeInterval -Type Object -Mandatory:$false } It "Should have FrequencyRecurrenceFactor as a parameter" { - $CommandUnderTest | Should -HaveParameter FrequencyRecurrenceFactor -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FrequencyRecurrenceFactor -Type Int32 -Mandatory:$false } It "Should have StartDate as a parameter" { - $CommandUnderTest | Should -HaveParameter StartDate -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter StartDate -Type String -Mandatory:$false } It "Should have EndDate as a parameter" { - $CommandUnderTest | Should -HaveParameter EndDate -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EndDate -Type String -Mandatory:$false } It "Should have StartTime as a parameter" { - $CommandUnderTest | Should -HaveParameter StartTime -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter StartTime -Type String -Mandatory:$false } It "Should have EndTime as a parameter" { - $CommandUnderTest | Should -HaveParameter EndTime -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EndTime -Type String -Mandatory:$false } It "Should have Owner as a parameter" { - $CommandUnderTest | Should -HaveParameter Owner -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Owner -Type String -Mandatory:$false } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/New-DbaAzAccessToken.Tests.ps1 b/tests/New-DbaAzAccessToken.Tests.ps1 index 66afb7397e..083deedaea 100644 --- a/tests/New-DbaAzAccessToken.Tests.ps1 +++ b/tests/New-DbaAzAccessToken.Tests.ps1 @@ -10,28 +10,28 @@ Describe "New-DbaAzAccessToken" { $CommandUnderTest = Get-Command New-DbaAzAccessToken } It "Should have Type as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String -Mandatory:$false } It "Should have Subtype as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Subtype -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Subtype -Type String -Mandatory:$false } It "Should have Config as a non-mandatory Object parameter" { - $CommandUnderTest | Should -HaveParameter Config -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Config -Type Object -Mandatory:$false } It "Should have Credential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have Tenant as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Tenant -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Tenant -Type String -Mandatory:$false } It "Should have Thumbprint as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Thumbprint -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Thumbprint -Type String -Mandatory:$false } It "Should have Store as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Store -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Store -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/New-DbaComputerCertificate.Tests.ps1 b/tests/New-DbaComputerCertificate.Tests.ps1 index 636a25aeec..bf6495b9d3 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have CaServer as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter CaServer -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CaServer -Type String -Mandatory:$false } It "Should have CaName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter CaName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CaName -Type String -Mandatory:$false } It "Should have ClusterInstanceName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ClusterInstanceName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ClusterInstanceName -Type String -Mandatory:$false } It "Should have SecurePassword as a non-mandatory SecureString parameter" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type SecureString -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SecurePassword -Type SecureString -Mandatory:$false } It "Should have FriendlyName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter FriendlyName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FriendlyName -Type String -Mandatory:$false } It "Should have CertificateTemplate as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter CertificateTemplate -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CertificateTemplate -Type String -Mandatory:$false } It "Should have KeyLength as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter KeyLength -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter KeyLength -Type Int32 -Mandatory:$false } It "Should have Store as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Store -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Store -Type String -Mandatory:$false } It "Should have Folder as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Folder -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Folder -Type String -Mandatory:$false } It "Should have Flag as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Flag -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Flag -Type String[] -Mandatory:$false } It "Should have Dns as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Dns -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Dns -Type String[] -Mandatory:$false } It "Should have SelfSigned as a non-mandatory Switch parameter" { - $CommandUnderTest | Should -HaveParameter SelfSigned -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SelfSigned -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have HashAlgorithm as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter HashAlgorithm -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter HashAlgorithm -Type String -Mandatory:$false } It "Should have MonthsValid as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter MonthsValid -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MonthsValid -Type Int32 -Mandatory:$false } } } diff --git a/tests/New-DbaComputerCertificateSigningRequest.Tests.ps1 b/tests/New-DbaComputerCertificateSigningRequest.Tests.ps1 index 6f6be57dfb..584a31e835 100644 --- a/tests/New-DbaComputerCertificateSigningRequest.Tests.ps1 +++ b/tests/New-DbaComputerCertificateSigningRequest.Tests.ps1 @@ -6,28 +6,28 @@ Describe "New-DbaComputerCertificateSigningRequest" { $CommandUnderTest = Get-Command New-DbaComputerCertificateSigningRequest } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have ClusterInstanceName as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ClusterInstanceName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ClusterInstanceName -Type String -Mandatory:$false } It "Should have Path as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have FriendlyName as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter FriendlyName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FriendlyName -Type String -Mandatory:$false } It "Should have KeyLength as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter KeyLength -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter KeyLength -Type Int32 -Mandatory:$false } It "Should have Dns as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Dns -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Dns -Type String[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaConnectionString.Tests.ps1 b/tests/New-DbaConnectionString.Tests.ps1 index 45f5b1844f..012243e0cb 100644 --- a/tests/New-DbaConnectionString.Tests.ps1 +++ b/tests/New-DbaConnectionString.Tests.ps1 @@ -6,82 +6,82 @@ Describe "New-DbaConnectionString" { $CommandUnderTest = Get-Command New-DbaConnectionString } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have AccessToken as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter AccessToken -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AccessToken -Type String -Mandatory:$false } It "Should have ApplicationIntent as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ApplicationIntent -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ApplicationIntent -Type String -Mandatory:$false } It "Should have BatchSeparator as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter BatchSeparator -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter BatchSeparator -Type String -Mandatory:$false } It "Should have ClientName as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ClientName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ClientName -Type String -Mandatory:$false } It "Should have ConnectTimeout as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter ConnectTimeout -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ConnectTimeout -Type Int32 -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Database -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String -Mandatory:$false } It "Should have EncryptConnection as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EncryptConnection -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EncryptConnection -Type Switch -Mandatory:$false } It "Should have FailoverPartner as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter FailoverPartner -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FailoverPartner -Type String -Mandatory:$false } It "Should have IsActiveDirectoryUniversalAuth as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IsActiveDirectoryUniversalAuth -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IsActiveDirectoryUniversalAuth -Type Switch -Mandatory:$false } It "Should have LockTimeout as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter LockTimeout -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LockTimeout -Type Int32 -Mandatory:$false } It "Should have MaxPoolSize as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter MaxPoolSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaxPoolSize -Type Int32 -Mandatory:$false } It "Should have MinPoolSize as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter MinPoolSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MinPoolSize -Type Int32 -Mandatory:$false } It "Should have MultipleActiveResultSets as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter MultipleActiveResultSets -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MultipleActiveResultSets -Type Switch -Mandatory:$false } It "Should have MultiSubnetFailover as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter MultiSubnetFailover -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MultiSubnetFailover -Type Switch -Mandatory:$false } It "Should have NetworkProtocol as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter NetworkProtocol -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NetworkProtocol -Type String -Mandatory:$false } It "Should have NonPooledConnection as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter NonPooledConnection -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NonPooledConnection -Type Switch -Mandatory:$false } It "Should have PacketSize as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter PacketSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PacketSize -Type Int32 -Mandatory:$false } It "Should have PooledConnectionLifetime as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter PooledConnectionLifetime -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PooledConnectionLifetime -Type Int32 -Mandatory:$false } It "Should have SqlExecutionModes as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter SqlExecutionModes -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlExecutionModes -Type String -Mandatory:$false } It "Should have StatementTimeout as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter StatementTimeout -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter StatementTimeout -Type Int32 -Mandatory:$false } It "Should have TrustServerCertificate as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter TrustServerCertificate -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter TrustServerCertificate -Type Switch -Mandatory:$false } It "Should have WorkstationId as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WorkstationId -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WorkstationId -Type String -Mandatory:$false } It "Should have Legacy as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Legacy -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Legacy -Type Switch -Mandatory:$false } It "Should have AppendConnectionString as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter AppendConnectionString -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AppendConnectionString -Type String -Mandatory:$false } } diff --git a/tests/New-DbaConnectionStringBuilder.Tests.ps1 b/tests/New-DbaConnectionStringBuilder.Tests.ps1 index c372b9032f..63205fad57 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 String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ConnectionString -Type String[] -Mandatory:$false } It "Should have ApplicationName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ApplicationName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ApplicationName -Type String -Mandatory:$false } It "Should have DataSource as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter DataSource -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DataSource -Type String -Mandatory:$false } It "Should have SqlCredential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have InitialCatalog as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter InitialCatalog -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InitialCatalog -Type String -Mandatory:$false } It "Should have IntegratedSecurity as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter IntegratedSecurity -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IntegratedSecurity -Type Switch -Mandatory:$false } It "Should have UserName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter UserName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter UserName -Type String -Mandatory:$false } It "Should have Password as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Password -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Password -Type String -Mandatory:$false } It "Should have MultipleActiveResultSets as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter MultipleActiveResultSets -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MultipleActiveResultSets -Type Switch -Mandatory:$false } It "Should have ColumnEncryptionSetting as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ColumnEncryptionSetting -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ColumnEncryptionSetting -Type String -Mandatory:$false } It "Should have Legacy as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Legacy -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Legacy -Type Switch -Mandatory:$false } It "Should have NonPooledConnection as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter NonPooledConnection -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NonPooledConnection -Type Switch -Mandatory:$false } It "Should have WorkstationId as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter WorkstationId -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WorkstationId -Type String -Mandatory:$false } } diff --git a/tests/New-DbaCustomError.Tests.ps1 b/tests/New-DbaCustomError.Tests.ps1 index 80d701c618..d8f6c322a4 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have MessageID as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter MessageID -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MessageID -Type Int32 -Mandatory:$false } It "Should have Severity as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter Severity -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Severity -Type Int32 -Mandatory:$false } It "Should have MessageText as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter MessageText -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MessageText -Type String -Mandatory:$false } It "Should have Language as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Language -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Language -Type String -Mandatory:$false } It "Should have WithLog as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter WithLog -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WithLog -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaDacOption.Tests.ps1 b/tests/New-DbaDacOption.Tests.ps1 index 16ff8e58fd..955376e32e 100644 --- a/tests/New-DbaDacOption.Tests.ps1 +++ b/tests/New-DbaDacOption.Tests.ps1 @@ -6,19 +6,19 @@ Describe "New-DbaDacOption" { $CommandUnderTest = Get-Command New-DbaDacOption } It "Should have Type as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String -Mandatory:$false } It "Should have Action as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Action -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Action -Type String -Mandatory:$false } It "Should have PublishXml as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter PublishXml -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PublishXml -Type String -Mandatory:$false } It "Should have Property as a non-mandatory Hashtable parameter" { - $CommandUnderTest | Should -HaveParameter Property -Type Hashtable -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Property -Type Hashtable -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaDatabase.Tests.ps1 b/tests/New-DbaDatabase.Tests.ps1 index ade9e5f552..9078b1d879 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Name parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String[] -Mandatory:$false } It "Should have Collation parameter" { - $CommandUnderTest | Should -HaveParameter Collation -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Collation -Type String -Mandatory:$false } It "Should have RecoveryModel parameter" { - $CommandUnderTest | Should -HaveParameter RecoveryModel -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RecoveryModel -Type String -Mandatory:$false } It "Should have Owner parameter" { - $CommandUnderTest | Should -HaveParameter Owner -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Owner -Type String -Mandatory:$false } It "Should have DataFilePath parameter" { - $CommandUnderTest | Should -HaveParameter DataFilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DataFilePath -Type String -Mandatory:$false } It "Should have LogFilePath parameter" { - $CommandUnderTest | Should -HaveParameter LogFilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LogFilePath -Type String -Mandatory:$false } It "Should have PrimaryFilesize parameter" { - $CommandUnderTest | Should -HaveParameter PrimaryFilesize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PrimaryFilesize -Type Int32 -Mandatory:$false } It "Should have PrimaryFileGrowth parameter" { - $CommandUnderTest | Should -HaveParameter PrimaryFileGrowth -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PrimaryFileGrowth -Type Int32 -Mandatory:$false } It "Should have PrimaryFileMaxSize parameter" { - $CommandUnderTest | Should -HaveParameter PrimaryFileMaxSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PrimaryFileMaxSize -Type Int32 -Mandatory:$false } It "Should have LogSize parameter" { - $CommandUnderTest | Should -HaveParameter LogSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LogSize -Type Int32 -Mandatory:$false } It "Should have LogGrowth parameter" { - $CommandUnderTest | Should -HaveParameter LogGrowth -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LogGrowth -Type Int32 -Mandatory:$false } It "Should have LogMaxSize parameter" { - $CommandUnderTest | Should -HaveParameter LogMaxSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LogMaxSize -Type Int32 -Mandatory:$false } It "Should have SecondaryFilesize parameter" { - $CommandUnderTest | Should -HaveParameter SecondaryFilesize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SecondaryFilesize -Type Int32 -Mandatory:$false } It "Should have SecondaryFileGrowth parameter" { - $CommandUnderTest | Should -HaveParameter SecondaryFileGrowth -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SecondaryFileGrowth -Type Int32 -Mandatory:$false } It "Should have SecondaryFileMaxSize parameter" { - $CommandUnderTest | Should -HaveParameter SecondaryFileMaxSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SecondaryFileMaxSize -Type Int32 -Mandatory:$false } It "Should have SecondaryFileCount parameter" { - $CommandUnderTest | Should -HaveParameter SecondaryFileCount -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SecondaryFileCount -Type Int32 -Mandatory:$false } It "Should have DefaultFileGroup parameter" { - $CommandUnderTest | Should -HaveParameter DefaultFileGroup -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DefaultFileGroup -Type String -Mandatory:$false } It "Should have DataFileSuffix parameter" { - $CommandUnderTest | Should -HaveParameter DataFileSuffix -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DataFileSuffix -Type String -Mandatory:$false } It "Should have LogFileSuffix parameter" { - $CommandUnderTest | Should -HaveParameter LogFileSuffix -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LogFileSuffix -Type String -Mandatory:$false } It "Should have SecondaryDataFileSuffix parameter" { - $CommandUnderTest | Should -HaveParameter SecondaryDataFileSuffix -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SecondaryDataFileSuffix -Type String -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaDbDataGeneratorConfig.Tests.ps1 b/tests/New-DbaDbDataGeneratorConfig.Tests.ps1 index bd86cd52ec..89bbcf2bdc 100644 --- a/tests/New-DbaDbDataGeneratorConfig.Tests.ps1 +++ b/tests/New-DbaDbDataGeneratorConfig.Tests.ps1 @@ -26,34 +26,34 @@ Describe "New-DbaDbDataGeneratorConfig" { $CommandUnderTest = Get-Command New-DbaDbDataGeneratorConfig } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have Table as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Table -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Table -Type String[] -Mandatory:$false } It "Should have ResetIdentity as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ResetIdentity -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ResetIdentity -Type Switch -Mandatory:$false } It "Should have TruncateTable as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter TruncateTable -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter TruncateTable -Type Switch -Mandatory:$false } It "Should have Rows as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter Rows -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Rows -Type Int32 -Mandatory:$false } It "Should have Path as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have Force as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaDbEncryptionKey.Tests.ps1 b/tests/New-DbaDbEncryptionKey.Tests.ps1 index 8146b36c6d..5f327c90df 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have EncryptorName parameter" { - $CommandUnderTest | Should -HaveParameter EncryptorName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EncryptorName -Type String -Mandatory:$false } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String -Mandatory:$false } It "Should have EncryptionAlgorithm parameter" { - $CommandUnderTest | Should -HaveParameter EncryptionAlgorithm -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EncryptionAlgorithm -Type String -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/New-DbaDbFileGroup.Tests.ps1 b/tests/New-DbaDbFileGroup.Tests.ps1 index 154c2b45c5..cdcb86dce7 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have FileGroup parameter" { - $CommandUnderTest | Should -HaveParameter FileGroup -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FileGroup -Type String -Mandatory:$false } It "Should have FileGroupType parameter" { - $CommandUnderTest | Should -HaveParameter FileGroupType -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FileGroupType -Type String -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaDbMailAccount.Tests.ps1 b/tests/New-DbaDbMailAccount.Tests.ps1 index ca405ce7ed..aa2abef320 100644 --- a/tests/New-DbaDbMailAccount.Tests.ps1 +++ b/tests/New-DbaDbMailAccount.Tests.ps1 @@ -6,34 +6,34 @@ Describe "New-DbaDbMailAccount" { $CommandUnderTest = Get-Command New-DbaDbMailAccount } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Account as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Account -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Account -Type String -Mandatory:$false } It "Should have DisplayName as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter DisplayName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DisplayName -Type String -Mandatory:$false } It "Should have Description as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Description -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Description -Type String -Mandatory:$false } It "Should have EmailAddress as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter EmailAddress -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EmailAddress -Type String -Mandatory:$false } It "Should have ReplyToAddress as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ReplyToAddress -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ReplyToAddress -Type String -Mandatory:$false } It "Should have MailServer as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter MailServer -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MailServer -Type String -Mandatory:$false } It "Should have Force as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaDbMailProfile.Tests.ps1 b/tests/New-DbaDbMailProfile.Tests.ps1 index 8ab2549a72..5d327e55af 100644 --- a/tests/New-DbaDbMailProfile.Tests.ps1 +++ b/tests/New-DbaDbMailProfile.Tests.ps1 @@ -6,25 +6,25 @@ Describe "New-DbaDbMailProfile" { $CommandUnderTest = Get-Command New-DbaDbMailProfile } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Profile as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Profile -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Profile -Type String -Mandatory:$false } It "Should have Description as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Description -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Description -Type String -Mandatory:$false } It "Should have MailAccountName as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter MailAccountName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MailAccountName -Type String -Mandatory:$false } It "Should have MailAccountPriority as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter MailAccountPriority -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MailAccountPriority -Type Int32 -Mandatory:$false } It "Should have EnableException as a non-mandatory parameter of type Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaDbMaskingConfig.Tests.ps1 b/tests/New-DbaDbMaskingConfig.Tests.ps1 index 8cff4cd20e..2ab9f94135 100644 --- a/tests/New-DbaDbMaskingConfig.Tests.ps1 +++ b/tests/New-DbaDbMaskingConfig.Tests.ps1 @@ -6,52 +6,52 @@ Describe "New-DbaDbMaskingConfig" { $CommandUnderTest = Get-Command New-DbaDbMaskingConfig } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have Table as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Table -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Table -Type String[] -Mandatory:$false } It "Should have Column as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Column -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Column -Type String[] -Mandatory:$false } It "Should have Path as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have Locale as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Locale -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Locale -Type String -Mandatory:$false } It "Should have CharacterString as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter CharacterString -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CharacterString -Type String -Mandatory:$false } It "Should have SampleCount as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter SampleCount -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SampleCount -Type Int32 -Mandatory:$false } It "Should have KnownNameFilePath as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter KnownNameFilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter KnownNameFilePath -Type String -Mandatory:$false } It "Should have PatternFilePath as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PatternFilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PatternFilePath -Type String -Mandatory:$false } It "Should have ExcludeDefaultKnownName as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDefaultKnownName -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDefaultKnownName -Type Switch -Mandatory:$false } It "Should have ExcludeDefaultPattern as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDefaultPattern -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDefaultPattern -Type Switch -Mandatory:$false } It "Should have Force as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaDbUser.Tests.ps1 b/tests/New-DbaDbUser.Tests.ps1 index e77dcb543d..67742ad3c1 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have IncludeSystem as a parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystem -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeSystem -Type Switch -Mandatory:$false } It "Should have User as a parameter" { - $CommandUnderTest | Should -HaveParameter User -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter User -Type String -Mandatory:$false } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Login -Type String -Mandatory:$false } It "Should have SecurePassword as a parameter" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type SecureString -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SecurePassword -Type SecureString -Mandatory:$false } It "Should have ExternalProvider as a parameter" { - $CommandUnderTest | Should -HaveParameter ExternalProvider -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExternalProvider -Type Switch -Mandatory:$false } It "Should have DefaultSchema as a parameter" { - $CommandUnderTest | Should -HaveParameter DefaultSchema -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DefaultSchema -Type String -Mandatory:$false } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaDirectory.Tests.ps1 b/tests/New-DbaDirectory.Tests.ps1 index fdd0305be3..1ca5cdfac5 100644 --- a/tests/New-DbaDirectory.Tests.ps1 +++ b/tests/New-DbaDirectory.Tests.ps1 @@ -10,58 +10,58 @@ Describe "New-DbaDirectory" { $CommandUnderTest = Get-Command New-DbaDirectory } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Path as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } It "Should have WhatIf as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Should have Confirm as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaFirewallRule.Tests.ps1 b/tests/New-DbaFirewallRule.Tests.ps1 index c903e89df8..5f76c78866 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String[] -Mandatory:$false } It "Should have Configuration parameter" { - $CommandUnderTest | Should -HaveParameter Configuration -Type Hashtable -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Configuration -Type Hashtable -Mandatory:$false } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaLinkedServerLogin.Tests.ps1 b/tests/New-DbaLinkedServerLogin.Tests.ps1 index 7918720aeb..d80658367c 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have LinkedServer parameter" { - $CommandUnderTest | Should -HaveParameter LinkedServer -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LinkedServer -Type String[] -Mandatory:$false } It "Should have LocalLogin parameter" { - $CommandUnderTest | Should -HaveParameter LocalLogin -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LocalLogin -Type String -Mandatory:$false } It "Should have RemoteUser parameter" { - $CommandUnderTest | Should -HaveParameter RemoteUser -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RemoteUser -Type String -Mandatory:$false } It "Should have RemoteUserPassword parameter" { - $CommandUnderTest | Should -HaveParameter RemoteUserPassword -Type SecureString -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RemoteUserPassword -Type SecureString -Mandatory:$false } It "Should have Impersonate parameter" { - $CommandUnderTest | Should -HaveParameter Impersonate -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Impersonate -Type Switch -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type LinkedServer[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type LinkedServer[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/New-DbaLogin.Tests.ps1 b/tests/New-DbaLogin.Tests.ps1 index 8654a7d802..cacace44ae 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 DbaInstanceParameter[] -Not -Mandatory + $Command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $Command | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $Command | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Login parameter" { - $Command | Should -HaveParameter Login -Type String[] -Not -Mandatory + $Command | Should -HaveParameter Login -Type String[] -Mandatory:$false } It "Should have InputObject parameter" { - $Command | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $Command | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have LoginRenameHashtable parameter" { - $Command | Should -HaveParameter LoginRenameHashtable -Type Hashtable -Not -Mandatory + $Command | Should -HaveParameter LoginRenameHashtable -Type Hashtable -Mandatory:$false } It "Should have SecurePassword parameter" { - $Command | Should -HaveParameter SecurePassword -Type SecureString -Not -Mandatory + $Command | Should -HaveParameter SecurePassword -Type SecureString -Mandatory:$false } It "Should have HashedPassword parameter" { - $Command | Should -HaveParameter HashedPassword -Type String -Not -Mandatory + $Command | Should -HaveParameter HashedPassword -Type String -Mandatory:$false } It "Should have MapToCertificate parameter" { - $Command | Should -HaveParameter MapToCertificate -Type String -Not -Mandatory + $Command | Should -HaveParameter MapToCertificate -Type String -Mandatory:$false } It "Should have MapToAsymmetricKey parameter" { - $Command | Should -HaveParameter MapToAsymmetricKey -Type String -Not -Mandatory + $Command | Should -HaveParameter MapToAsymmetricKey -Type String -Mandatory:$false } It "Should have MapToCredential parameter" { - $Command | Should -HaveParameter MapToCredential -Type String -Not -Mandatory + $Command | Should -HaveParameter MapToCredential -Type String -Mandatory:$false } It "Should have Sid parameter" { - $Command | Should -HaveParameter Sid -Type Object -Not -Mandatory + $Command | Should -HaveParameter Sid -Type Object -Mandatory:$false } It "Should have DefaultDatabase parameter" { - $Command | Should -HaveParameter DefaultDatabase -Type String -Not -Mandatory + $Command | Should -HaveParameter DefaultDatabase -Type String -Mandatory:$false } It "Should have Language parameter" { - $Command | Should -HaveParameter Language -Type String -Not -Mandatory + $Command | Should -HaveParameter Language -Type String -Mandatory:$false } It "Should have PasswordExpirationEnabled parameter" { - $Command | Should -HaveParameter PasswordExpirationEnabled -Type Switch -Not -Mandatory + $Command | Should -HaveParameter PasswordExpirationEnabled -Type Switch -Mandatory:$false } It "Should have PasswordPolicyEnforced parameter" { - $Command | Should -HaveParameter PasswordPolicyEnforced -Type Switch -Not -Mandatory + $Command | Should -HaveParameter PasswordPolicyEnforced -Type Switch -Mandatory:$false } It "Should have PasswordMustChange parameter" { - $Command | Should -HaveParameter PasswordMustChange -Type Switch -Not -Mandatory + $Command | Should -HaveParameter PasswordMustChange -Type Switch -Mandatory:$false } It "Should have Disabled parameter" { - $Command | Should -HaveParameter Disabled -Type Switch -Not -Mandatory + $Command | Should -HaveParameter Disabled -Type Switch -Mandatory:$false } It "Should have DenyWindowsLogin parameter" { - $Command | Should -HaveParameter DenyWindowsLogin -Type Switch -Not -Mandatory + $Command | Should -HaveParameter DenyWindowsLogin -Type Switch -Mandatory:$false } It "Should have NewSid parameter" { - $Command | Should -HaveParameter NewSid -Type Switch -Not -Mandatory + $Command | Should -HaveParameter NewSid -Type Switch -Mandatory:$false } It "Should have ExternalProvider parameter" { - $Command | Should -HaveParameter ExternalProvider -Type Switch -Not -Mandatory + $Command | Should -HaveParameter ExternalProvider -Type Switch -Mandatory:$false } It "Should have Force parameter" { - $Command | Should -HaveParameter Force -Type Switch -Not -Mandatory + $Command | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $Command | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $Command | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaReplCreationScriptOptions.Tests.ps1 b/tests/New-DbaReplCreationScriptOptions.Tests.ps1 index ce18cbcc08..be4fd646af 100644 --- a/tests/New-DbaReplCreationScriptOptions.Tests.ps1 +++ b/tests/New-DbaReplCreationScriptOptions.Tests.ps1 @@ -11,10 +11,10 @@ Describe "New-DbaReplCreationScriptOptions" { $CommandUnderTest = Get-Command New-DbaReplCreationScriptOptions } It "Should have Options as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Options -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Options -Type String[] -Mandatory:$false } It "Should have NoDefaults as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter NoDefaults -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoDefaults -Type Switch -Mandatory:$false } } } diff --git a/tests/New-DbaRgResourcePool.Tests.ps1 b/tests/New-DbaRgResourcePool.Tests.ps1 index 2310a26f7b..60fdeb7ff4 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have ResourcePool parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePool -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ResourcePool -Type String[] -Mandatory:$false } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String -Mandatory:$false } It "Should have MinimumCpuPercentage parameter" { - $CommandUnderTest | Should -HaveParameter MinimumCpuPercentage -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MinimumCpuPercentage -Type Int32 -Mandatory:$false } It "Should have MaximumCpuPercentage parameter" { - $CommandUnderTest | Should -HaveParameter MaximumCpuPercentage -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaximumCpuPercentage -Type Int32 -Mandatory:$false } It "Should have CapCpuPercentage parameter" { - $CommandUnderTest | Should -HaveParameter CapCpuPercentage -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CapCpuPercentage -Type Int32 -Mandatory:$false } It "Should have MinimumMemoryPercentage parameter" { - $CommandUnderTest | Should -HaveParameter MinimumMemoryPercentage -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MinimumMemoryPercentage -Type Int32 -Mandatory:$false } It "Should have MaximumMemoryPercentage parameter" { - $CommandUnderTest | Should -HaveParameter MaximumMemoryPercentage -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaximumMemoryPercentage -Type Int32 -Mandatory:$false } It "Should have MinimumIOPSPerVolume parameter" { - $CommandUnderTest | Should -HaveParameter MinimumIOPSPerVolume -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MinimumIOPSPerVolume -Type Int32 -Mandatory:$false } It "Should have MaximumIOPSPerVolume parameter" { - $CommandUnderTest | Should -HaveParameter MaximumIOPSPerVolume -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaximumIOPSPerVolume -Type Int32 -Mandatory:$false } It "Should have MaximumProcesses parameter" { - $CommandUnderTest | Should -HaveParameter MaximumProcesses -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaximumProcesses -Type Int32 -Mandatory:$false } It "Should have SkipReconfigure parameter" { - $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type Switch -Mandatory:$false } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaSqlParameter.Tests.ps1 b/tests/New-DbaSqlParameter.Tests.ps1 index 692bc20339..6c075bb33a 100644 --- a/tests/New-DbaSqlParameter.Tests.ps1 +++ b/tests/New-DbaSqlParameter.Tests.ps1 @@ -6,64 +6,64 @@ Describe "New-DbaSqlParameter" { $CommandUnderTest = Get-Command New-DbaSqlParameter } It "Should have CompareInfo as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter CompareInfo -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CompareInfo -Type String -Mandatory:$false } It "Should have DbType as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter DbType -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DbType -Type String -Mandatory:$false } It "Should have Direction as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Direction -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Direction -Type String -Mandatory:$false } It "Should have ForceColumnEncryption as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter ForceColumnEncryption -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ForceColumnEncryption -Type Switch -Mandatory:$false } It "Should have IsNullable as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter IsNullable -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IsNullable -Type Switch -Mandatory:$false } It "Should have LocaleId as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter LocaleId -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LocaleId -Type Int32 -Mandatory:$false } It "Should have Offset as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Offset -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Offset -Type String -Mandatory:$false } It "Should have ParameterName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ParameterName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ParameterName -Type String -Mandatory:$false } It "Should have Precision as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Precision -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Precision -Type String -Mandatory:$false } It "Should have Scale as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Scale -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Scale -Type String -Mandatory:$false } It "Should have Size as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter Size -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Size -Type Int32 -Mandatory:$false } It "Should have SourceColumn as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter SourceColumn -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SourceColumn -Type String -Mandatory:$false } It "Should have SourceColumnNullMapping as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter SourceColumnNullMapping -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SourceColumnNullMapping -Type Switch -Mandatory:$false } It "Should have SourceVersion as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter SourceVersion -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SourceVersion -Type String -Mandatory:$false } It "Should have SqlDbType as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter SqlDbType -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlDbType -Type String -Mandatory:$false } It "Should have SqlValue as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter SqlValue -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlValue -Type String -Mandatory:$false } It "Should have TypeName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter TypeName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter TypeName -Type String -Mandatory:$false } It "Should have UdtTypeName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter UdtTypeName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter UdtTypeName -Type String -Mandatory:$false } It "Should have Value as a non-mandatory Object parameter" { - $CommandUnderTest | Should -HaveParameter Value -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Value -Type Object -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/New-DbaXESession.Tests.ps1 b/tests/New-DbaXESession.Tests.ps1 index abc454c0de..54444ae6e0 100644 --- a/tests/New-DbaXESession.Tests.ps1 +++ b/tests/New-DbaXESession.Tests.ps1 @@ -10,58 +10,58 @@ Describe "New-DbaXESession" { $CommandUnderTest = Get-Command New-DbaXESession } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Name as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Name -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } It "Should have WhatIf as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Should have Confirm as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaXESmartCsvWriter.Tests.ps1 b/tests/New-DbaXESmartCsvWriter.Tests.ps1 index 04ad9d2ead..d45b742bee 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 String parameter" { - $CommandUnderTest | Should -HaveParameter OutputFile -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutputFile -Type String -Mandatory:$false } It "Should have Overwrite as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Overwrite -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Overwrite -Type Switch -Mandatory:$false } It "Should have Event as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Event -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Event -Type String[] -Mandatory:$false } It "Should have OutputColumn as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter OutputColumn -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutputColumn -Type String[] -Mandatory:$false } It "Should have Filter as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Filter -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Filter -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbaXESmartReplay.Tests.ps1 b/tests/New-DbaXESmartReplay.Tests.ps1 index 0d7c2d68b4..272030ed4f 100644 --- a/tests/New-DbaXESmartReplay.Tests.ps1 +++ b/tests/New-DbaXESmartReplay.Tests.ps1 @@ -12,31 +12,31 @@ Describe "New-DbaXESmartReplay" { $CommandUnderTest = Get-Command New-DbaXESmartReplay } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String -Mandatory:$false } It "Should have Event parameter" { - $CommandUnderTest | Should -HaveParameter Event -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Event -Type String[] -Mandatory:$false } It "Should have Filter parameter" { - $CommandUnderTest | Should -HaveParameter Filter -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Filter -Type String -Mandatory:$false } It "Should have DelaySeconds parameter" { - $CommandUnderTest | Should -HaveParameter DelaySeconds -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DelaySeconds -Type Int32 -Mandatory:$false } It "Should have StopOnError parameter" { - $CommandUnderTest | Should -HaveParameter StopOnError -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter StopOnError -Type Switch -Mandatory:$false } It "Should have ReplayIntervalSeconds parameter" { - $CommandUnderTest | Should -HaveParameter ReplayIntervalSeconds -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ReplayIntervalSeconds -Type Int32 -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/New-DbaXESmartTableWriter.Tests.ps1 b/tests/New-DbaXESmartTableWriter.Tests.ps1 index 49d2a7483d..7c57f6c217 100644 --- a/tests/New-DbaXESmartTableWriter.Tests.ps1 +++ b/tests/New-DbaXESmartTableWriter.Tests.ps1 @@ -12,34 +12,34 @@ Describe "New-DbaXESmartTableWriter" { $CommandUnderTest = Get-Command New-DbaXESmartTableWriter } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Database -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String -Mandatory:$false } It "Should have Table as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Table -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Table -Type String -Mandatory:$false } It "Should have AutoCreateTargetTable as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter AutoCreateTargetTable -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AutoCreateTargetTable -Type Switch -Mandatory:$false } It "Should have UploadIntervalSeconds as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter UploadIntervalSeconds -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter UploadIntervalSeconds -Type Int32 -Mandatory:$false } It "Should have Event as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Event -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Event -Type String[] -Mandatory:$false } It "Should have OutputColumn as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter OutputColumn -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutputColumn -Type String[] -Mandatory:$false } It "Should have Filter as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Filter -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Filter -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/New-DbatoolsSupportPackage.Tests.ps1 b/tests/New-DbatoolsSupportPackage.Tests.ps1 index b6186f6cf9..3e914c4063 100644 --- a/tests/New-DbatoolsSupportPackage.Tests.ps1 +++ b/tests/New-DbatoolsSupportPackage.Tests.ps1 @@ -11,58 +11,58 @@ Describe "New-DbatoolsSupportPackage" { $CommandUnderTest = Get-Command New-DbatoolsSupportPackage } It "Should have Path as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have Variables as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Variables -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Variables -Type String[] -Mandatory:$false } It "Should have PassThru as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter PassThru -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PassThru -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory ActionPreference parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory ActionPreference parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory ActionPreference parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory ActionPreference parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } It "Should have WhatIf as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Should have Confirm as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } diff --git a/tests/Read-DbaAuditFile.Tests.ps1 b/tests/Read-DbaAuditFile.Tests.ps1 index 7a67485f51..67390cc1a1 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 Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type Object[] -Mandatory:$false } It "Should have Raw as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Raw -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Raw -Type Switch -Mandatory:$false } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Read-DbaXEFile.Tests.ps1 b/tests/Read-DbaXEFile.Tests.ps1 index 2b300f38ba..6fe41f9d1e 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 Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type Object[] -Mandatory:$false } It "Should have Raw as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Raw -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Raw -Type switch -Mandatory:$false } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Remove-DbaAgDatabase.Tests.ps1 b/tests/Remove-DbaAgDatabase.Tests.ps1 index 34e1b5f6c1..00d39ed259 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have AvailabilityGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Remove-DbaAgentAlert.Tests.ps1 b/tests/Remove-DbaAgentAlert.Tests.ps1 index ac222c1a5b..78e50ca048 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Alert parameter" { - $CommandUnderTest | Should -HaveParameter Alert -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Alert -Type String[] -Mandatory:$false } It "Should have ExcludeAlert parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeAlert -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeAlert -Type String[] -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Alert[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Alert[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Remove-DbaAgentAlertCategory.Tests.ps1 b/tests/Remove-DbaAgentAlertCategory.Tests.ps1 index 996e508cf3..cb14199b18 100644 --- a/tests/Remove-DbaAgentAlertCategory.Tests.ps1 +++ b/tests/Remove-DbaAgentAlertCategory.Tests.ps1 @@ -6,19 +6,19 @@ Describe "Remove-DbaAgentAlertCategory" { $CommandUnderTest = Get-Command Remove-DbaAgentAlertCategory } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Category as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Category -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Category -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type AlertCategory[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type AlertCategory[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type AlertCategory[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaAgentJob.Tests.ps1 b/tests/Remove-DbaAgentJob.Tests.ps1 index 8ba11aaaae..37fca7dee8 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Job as a parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Job -Type Object[] -Mandatory:$false } It "Should have KeepHistory as a switch parameter" { - $CommandUnderTest | Should -HaveParameter KeepHistory -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter KeepHistory -Type switch -Mandatory:$false } It "Should have KeepUnusedSchedule as a switch parameter" { - $CommandUnderTest | Should -HaveParameter KeepUnusedSchedule -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter KeepUnusedSchedule -Type switch -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Job[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Job[] -Mandatory:$false } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } } diff --git a/tests/Remove-DbaAgentJobCategory.Tests.ps1 b/tests/Remove-DbaAgentJobCategory.Tests.ps1 index b65eafbd83..7a6453e609 100644 --- a/tests/Remove-DbaAgentJobCategory.Tests.ps1 +++ b/tests/Remove-DbaAgentJobCategory.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Remove-DbaAgentJobCategory" { $CommandUnderTest = Get-Command Remove-DbaAgentJobCategory } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Category as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Category -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Category -Type String[] -Mandatory:$false } It "Should have CategoryType as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter CategoryType -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CategoryType -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type JobCategory[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type JobCategory[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type JobCategory[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Remove-DbaAgentSchedule.Tests.ps1 b/tests/Remove-DbaAgentSchedule.Tests.ps1 index 39d56761c7..d02ba7334c 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Schedule as a parameter" { - $CommandUnderTest | Should -HaveParameter Schedule -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Schedule -Type String[] -Mandatory:$false } It "Should have ScheduleUid as a parameter" { - $CommandUnderTest | Should -HaveParameter ScheduleUid -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ScheduleUid -Type String[] -Mandatory:$false } It "Should have Id as a parameter" { - $CommandUnderTest | Should -HaveParameter Id -Type Int32[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Id -Type Int32[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type ScheduleBase[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type ScheduleBase[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } } } diff --git a/tests/Remove-DbaCmConnection.Tests.ps1 b/tests/Remove-DbaCmConnection.Tests.ps1 index 12b8841b87..70a6aa2dce 100644 --- a/tests/Remove-DbaCmConnection.Tests.ps1 +++ b/tests/Remove-DbaCmConnection.Tests.ps1 @@ -6,52 +6,52 @@ Describe "Remove-DbaCmConnection" { $CommandUnderTest = Get-Command Remove-DbaCmConnection } It "Should have ComputerName as a parameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaCmConnectionParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaCmConnectionParameter[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } } diff --git a/tests/Remove-DbaDatabase.Tests.ps1 b/tests/Remove-DbaDatabase.Tests.ps1 index f0d2a6b0dc..483e47b58a 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaDatabaseSafely.Tests.ps1 b/tests/Remove-DbaDatabaseSafely.Tests.ps1 index 3b5a6fe44a..0042e3879a 100644 --- a/tests/Remove-DbaDatabaseSafely.Tests.ps1 +++ b/tests/Remove-DbaDatabaseSafely.Tests.ps1 @@ -12,46 +12,46 @@ Describe "Remove-DbaDatabaseSafely" { $CommandUnderTest = Get-Command Remove-DbaDatabaseSafely } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have Destination as a non-mandatory parameter of type DbaInstanceParameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type DbaInstanceParameter -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Destination -Type DbaInstanceParameter -Mandatory:$false } It "Should have DestinationSqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type PSCredential -Mandatory:$false } It "Should have NoDbccCheckDb as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter NoDbccCheckDb -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoDbccCheckDb -Type Switch -Mandatory:$false } It "Should have BackupFolder as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter BackupFolder -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter BackupFolder -Type String -Mandatory:$false } It "Should have CategoryName as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter CategoryName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CategoryName -Type String -Mandatory:$false } It "Should have JobOwner as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter JobOwner -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter JobOwner -Type String -Mandatory:$false } It "Should have AllDatabases as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter AllDatabases -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AllDatabases -Type Switch -Mandatory:$false } It "Should have BackupCompression as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter BackupCompression -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter BackupCompression -Type String -Mandatory:$false } It "Should have ReuseSourceFolderStructure as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ReuseSourceFolderStructure -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ReuseSourceFolderStructure -Type Switch -Mandatory:$false } It "Should have Force as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaDbCertificate.Tests.ps1 b/tests/Remove-DbaDbCertificate.Tests.ps1 index 7f549f1aed..2319e12aff 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 DbaInstanceParameter[] -Not -Mandatory + $command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $command | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $command | Should -HaveParameter Database -Type String[] -Not -Mandatory + $command | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have Certificate parameter" { - $command | Should -HaveParameter Certificate -Type String[] -Not -Mandatory + $command | Should -HaveParameter Certificate -Type String[] -Mandatory:$false } It "Should have InputObject parameter" { - $command | Should -HaveParameter InputObject -Type Certificate[] -Not -Mandatory + $command | Should -HaveParameter InputObject -Type Certificate[] -Mandatory:$false } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $command | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Remove-DbaDbCheckConstraint.Tests.ps1 b/tests/Remove-DbaDbCheckConstraint.Tests.ps1 index d0ce93f005..18c4459cac 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have ExcludeSystemTable as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemTable -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSystemTable -Type Switch -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Check[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Check[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaDbFileGroup.Tests.ps1 b/tests/Remove-DbaDbFileGroup.Tests.ps1 index fef9b4f068..6a85d2f2d1 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have FileGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter FileGroup -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FileGroup -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Remove-DbaDbLogShipping.Tests.ps1 b/tests/Remove-DbaDbLogShipping.Tests.ps1 index ccf9a32662..ad130ecda4 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 DbaInstanceParameter" { - $CommandUnderTest | Should -HaveParameter PrimarySqlInstance -Type DbaInstanceParameter -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PrimarySqlInstance -Type DbaInstanceParameter -Mandatory:$false } It "Should have SecondarySqlInstance as a non-mandatory DbaInstanceParameter" { - $CommandUnderTest | Should -HaveParameter SecondarySqlInstance -Type DbaInstanceParameter -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SecondarySqlInstance -Type DbaInstanceParameter -Mandatory:$false } It "Should have PrimarySqlCredential as a non-mandatory PSCredential" { - $CommandUnderTest | Should -HaveParameter PrimarySqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PrimarySqlCredential -Type PSCredential -Mandatory:$false } It "Should have SecondarySqlCredential as a non-mandatory PSCredential" { - $CommandUnderTest | Should -HaveParameter SecondarySqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SecondarySqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory Object[]" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have RemoveSecondaryDatabase as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter RemoveSecondaryDatabase -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RemoveSecondaryDatabase -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Remove-DbaDbMailAccount.Tests.ps1 b/tests/Remove-DbaDbMailAccount.Tests.ps1 index 5f2275b907..37f1a1132b 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Account as a parameter" { - $CommandUnderTest | Should -HaveParameter Account -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Account -Type String[] -Mandatory:$false } It "Should have ExcludeAccount as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeAccount -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeAccount -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type MailAccount[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type MailAccount[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaDbMasterKey.Tests.ps1 b/tests/Remove-DbaDbMasterKey.Tests.ps1 index 7807fbc37f..e08762ac70 100644 --- a/tests/Remove-DbaDbMasterKey.Tests.ps1 +++ b/tests/Remove-DbaDbMasterKey.Tests.ps1 @@ -13,48 +13,48 @@ Describe "Remove-DbaDbMasterKey Unit Tests" -Tag 'UnitTests' { } It "Should have SqlInstance parameter" { - $command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $command | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $command | Should -HaveParameter Database -Type String[] -Not -Mandatory + $command | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $command | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $command | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have All parameter" { - $command | Should -HaveParameter All -Type Switch -Not -Mandatory + $command | Should -HaveParameter All -Type Switch -Mandatory:$false } It "Should have InputObject parameter" { - $command | Should -HaveParameter InputObject -Type MasterKey[] -Not -Mandatory + $command | Should -HaveParameter InputObject -Type MasterKey[] -Mandatory:$false } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $command | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have common parameters" { - $command | Should -HaveParameter Verbose -Type Switch -Not -Mandatory - $command | Should -HaveParameter Debug -Type Switch -Not -Mandatory - $command | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory - $command | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory - $command | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory - $command | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory - $command | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory - $command | Should -HaveParameter WarningVariable -Type String -Not -Mandatory - $command | Should -HaveParameter InformationVariable -Type String -Not -Mandatory - $command | Should -HaveParameter OutVariable -Type String -Not -Mandatory - $command | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory - $command | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory - $command | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory - $command | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $command | Should -HaveParameter Verbose -Type Switch -Mandatory:$false + $command | Should -HaveParameter Debug -Type Switch -Mandatory:$false + $command | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false + $command | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false + $command | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false + $command | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false + $command | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false + $command | Should -HaveParameter WarningVariable -Type String -Mandatory:$false + $command | Should -HaveParameter InformationVariable -Type String -Mandatory:$false + $command | Should -HaveParameter OutVariable -Type String -Mandatory:$false + $command | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false + $command | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false + $command | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false + $command | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } } diff --git a/tests/Remove-DbaDbMirror.Tests.ps1 b/tests/Remove-DbaDbMirror.Tests.ps1 index 38901d41b4..1e573734b8 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 DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have WhatIf as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Should have Confirm as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } } diff --git a/tests/Remove-DbaDbPartitionFunction.Tests.ps1 b/tests/Remove-DbaDbPartitionFunction.Tests.ps1 index 3e52022356..b54e860041 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type PartitionFunction[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type PartitionFunction[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaDbPartitionScheme.Tests.ps1 b/tests/Remove-DbaDbPartitionScheme.Tests.ps1 index b042078500..819c60f502 100644 --- a/tests/Remove-DbaDbPartitionScheme.Tests.ps1 +++ b/tests/Remove-DbaDbPartitionScheme.Tests.ps1 @@ -6,64 +6,64 @@ Describe "Remove-DbaDbPartitionScheme" { $CommandUnderTest = Get-Command Remove-DbaDbPartitionScheme } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type PartitionScheme[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type PartitionScheme[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } It "Should have WhatIf parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Should have Confirm parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } } diff --git a/tests/Remove-DbaDbRole.Tests.ps1 b/tests/Remove-DbaDbRole.Tests.ps1 index d51617d987..dd5cb6c4fd 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have Role parameter" { - $CommandUnderTest | Should -HaveParameter Role -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Role -Type String[] -Mandatory:$false } It "Should have ExcludeRole parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeRole -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeRole -Type String[] -Mandatory:$false } It "Should have IncludeSystemDbs parameter" { - $CommandUnderTest | Should -HaveParameter IncludeSystemDbs -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeSystemDbs -Type Switch -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Remove-DbaDbSchema.Tests.ps1 b/tests/Remove-DbaDbSchema.Tests.ps1 index d485075d8b..5fde22c76f 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaDbSequence.Tests.ps1 b/tests/Remove-DbaDbSequence.Tests.ps1 index 7d2a0ad7b4..cd11f1a16a 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have Sequence as a parameter" { - $CommandUnderTest | Should -HaveParameter Sequence -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Sequence -Type String[] -Mandatory:$false } It "Should have Schema as a parameter" { - $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Sequence[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Sequence[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaDbSnapshot.Tests.ps1 b/tests/Remove-DbaDbSnapshot.Tests.ps1 index ca1714d33b..e6ada23c2a 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have Snapshot parameter" { - $CommandUnderTest | Should -HaveParameter Snapshot -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Snapshot -Type String[] -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have AllSnapshots parameter" { - $CommandUnderTest | Should -HaveParameter AllSnapshots -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AllSnapshots -Type Switch -Mandatory:$false } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaDbTable.Tests.ps1 b/tests/Remove-DbaDbTable.Tests.ps1 index 9aa1412563..779c0d658c 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have Table as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Table -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Table -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Table[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Table[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Table[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaDbTableData.Tests.ps1 b/tests/Remove-DbaDbTableData.Tests.ps1 index 713aab07ca..334db64aad 100644 --- a/tests/Remove-DbaDbTableData.Tests.ps1 +++ b/tests/Remove-DbaDbTableData.Tests.ps1 @@ -54,40 +54,40 @@ Describe "Remove-DbaDbTableData" { $CommandUnderTest = Get-Command Remove-DbaDbTableData } It "Should have SqlInstance as a DbaInstanceParameter[] parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a PSCredential parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a String[] parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have BatchSize as an Int32 parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter BatchSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter BatchSize -Type Int32 -Mandatory:$false } It "Should have Table as a String parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter Table -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Table -Type String -Mandatory:$false } It "Should have DeleteSql as a String parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter DeleteSql -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DeleteSql -Type String -Mandatory:$false } It "Should have LogBackupPath as a String parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter LogBackupPath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LogBackupPath -Type String -Mandatory:$false } It "Should have LogBackupTimeStampFormat as a String parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter LogBackupTimeStampFormat -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LogBackupTimeStampFormat -Type String -Mandatory:$false } It "Should have AzureBaseUrl as a String[] parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter AzureBaseUrl -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AzureBaseUrl -Type String[] -Mandatory:$false } It "Should have AzureCredential as a String parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter AzureCredential -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AzureCredential -Type String -Mandatory:$false } It "Should have InputObject as an Object[] parameter that is not mandatory" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException as a Switch that is not mandatory" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaDbUdf.Tests.ps1 b/tests/Remove-DbaDbUdf.Tests.ps1 index b817701540..30887621cf 100644 --- a/tests/Remove-DbaDbUdf.Tests.ps1 +++ b/tests/Remove-DbaDbUdf.Tests.ps1 @@ -6,37 +6,37 @@ Describe "Remove-DbaDbUdf" { $CommandUnderTest = Get-Command Remove-DbaDbUdf } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have ExcludeSystemUdf as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystemUdf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSystemUdf -Type Switch -Mandatory:$false } It "Should have Schema as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Mandatory:$false } It "Should have ExcludeSchema as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeSchema -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSchema -Type String[] -Mandatory:$false } It "Should have Name as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Name -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String[] -Mandatory:$false } It "Should have ExcludeName as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeName -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type UserDefinedFunction[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type UserDefinedFunction[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type UserDefinedFunction[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaDbUser.Tests.ps1 b/tests/Remove-DbaDbUser.Tests.ps1 index c6af12ce55..478cb9fe20 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 DbaInstanceParameter[] -Not -Mandatory + $command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $command | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $command | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $command | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $command | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $command | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have User parameter" { - $command | Should -HaveParameter User -Type Object[] -Not -Mandatory + $command | Should -HaveParameter User -Type Object[] -Mandatory:$false } It "Should have InputObject parameter" { - $command | Should -HaveParameter InputObject -Type User[] -Not -Mandatory + $command | Should -HaveParameter InputObject -Type User[] -Mandatory:$false } It "Should have Force parameter" { - $command | Should -HaveParameter Force -Type Switch -Not -Mandatory + $command | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $command | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Remove-DbaDbView.Tests.ps1 b/tests/Remove-DbaDbView.Tests.ps1 index 89ee3f4332..e696429ee7 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have View as a parameter" { - $CommandUnderTest | Should -HaveParameter View -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter View -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type View[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type View[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaLinkedServerLogin.Tests.ps1 b/tests/Remove-DbaLinkedServerLogin.Tests.ps1 index c97c40bf30..ff87c82729 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have LinkedServer as a parameter" { - $CommandUnderTest | Should -HaveParameter LinkedServer -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LinkedServer -Type String[] -Mandatory:$false } It "Should have LocalLogin as a parameter" { - $CommandUnderTest | Should -HaveParameter LocalLogin -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LocalLogin -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaLogin.Tests.ps1 b/tests/Remove-DbaLogin.Tests.ps1 index 4747414851..8ab600e97e 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Login -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Login[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Login[] -Mandatory:$false } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaNetworkCertificate.Tests.ps1 b/tests/Remove-DbaNetworkCertificate.Tests.ps1 index 8e6b180a4e..021154d617 100644 --- a/tests/Remove-DbaNetworkCertificate.Tests.ps1 +++ b/tests/Remove-DbaNetworkCertificate.Tests.ps1 @@ -6,55 +6,55 @@ Describe "Remove-DbaNetworkCertificate" { $CommandUnderTest = Get-Command Remove-DbaNetworkCertificate } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } It "Should have WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Should have Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } } diff --git a/tests/Remove-DbaRgResourcePool.Tests.ps1 b/tests/Remove-DbaRgResourcePool.Tests.ps1 index 7e23fe5b22..c85451d410 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have ResourcePool parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePool -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ResourcePool -Type String[] -Mandatory:$false } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String -Mandatory:$false } It "Should have SkipReconfigure parameter" { - $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type Switch -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaRgWorkloadGroup.Tests.ps1 b/tests/Remove-DbaRgWorkloadGroup.Tests.ps1 index d730ac56c9..c56d4b9435 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have WorkloadGroup parameter" { - $CommandUnderTest | Should -HaveParameter WorkloadGroup -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WorkloadGroup -Type String[] -Mandatory:$false } It "Should have ResourcePool parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePool -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ResourcePool -Type String -Mandatory:$false } It "Should have ResourcePoolType parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePoolType -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ResourcePoolType -Type String -Mandatory:$false } It "Should have SkipReconfigure parameter" { - $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type Switch -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type WorkloadGroup[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type WorkloadGroup[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Remove-DbaServerRole.Tests.ps1 b/tests/Remove-DbaServerRole.Tests.ps1 index a3f2b26f55..d8c6269811 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have ServerRole as a parameter" { - $CommandUnderTest | Should -HaveParameter ServerRole -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ServerRole -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type ServerRole[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type ServerRole[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Remove-DbaXESmartTarget.Tests.ps1 b/tests/Remove-DbaXESmartTarget.Tests.ps1 index c3378243da..5549121c11 100644 --- a/tests/Remove-DbaXESmartTarget.Tests.ps1 +++ b/tests/Remove-DbaXESmartTarget.Tests.ps1 @@ -6,52 +6,52 @@ Describe "Remove-DbaXESmartTarget" { $CommandUnderTest = Get-Command Remove-DbaXESmartTarget } It "Accepts InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Accepts EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Accepts Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Accepts Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Accepts ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Accepts WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Accepts InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Accepts ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Accepts ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Accepts WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Accepts InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Accepts OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Accepts OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Accepts PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } It "Accepts WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Accepts Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } } diff --git a/tests/Repair-DbaDbMirror.Tests.ps1 b/tests/Repair-DbaDbMirror.Tests.ps1 index 85cd8df1af..c801ff024a 100644 --- a/tests/Repair-DbaDbMirror.Tests.ps1 +++ b/tests/Repair-DbaDbMirror.Tests.ps1 @@ -10,61 +10,61 @@ Describe "Repair-DbaDbMirror" { $CommandUnderTest = Get-Command Repair-DbaDbMirror } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Database[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } It "Should have WhatIf as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Should have Confirm as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } @@ -74,11 +74,11 @@ Describe "Repair-DbaDbMirror" { # BeforeAll { # # Setup code for integration tests # } - # + # # It "Should repair database mirror successfully" { # # Test code # } - # + # # AfterAll { # # Cleanup code for integration tests # } diff --git a/tests/Reset-DbatoolsConfig.Tests.ps1 b/tests/Reset-DbatoolsConfig.Tests.ps1 index 6a6dfa814c..2155ac945a 100644 --- a/tests/Reset-DbatoolsConfig.Tests.ps1 +++ b/tests/Reset-DbatoolsConfig.Tests.ps1 @@ -12,61 +12,61 @@ Describe "Reset-DbatoolsConfig" { $CommandUnderTest = Get-Command Reset-DbatoolsConfig } It "Should have ConfigurationItem as a non-mandatory parameter of type Config[]" { - $CommandUnderTest | Should -HaveParameter ConfigurationItem -Type Config[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ConfigurationItem -Type Config[] -Mandatory:$false } It "Should have FullName as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter FullName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FullName -Type String[] -Mandatory:$false } It "Should have Module as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Module -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Module -Type String -Mandatory:$false } It "Should have Name as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Name -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } It "Should have WhatIf as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Should have Confirm as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } } diff --git a/tests/Resolve-DbaPath.Tests.ps1 b/tests/Resolve-DbaPath.Tests.ps1 index ea7c52e4b4..f30c7b2934 100644 --- a/tests/Resolve-DbaPath.Tests.ps1 +++ b/tests/Resolve-DbaPath.Tests.ps1 @@ -12,52 +12,52 @@ Describe "Resolve-DbaPath Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Resolve-DbaPath } It "Should have Path as a parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String[] -Mandatory:$false } It "Should have Provider as a parameter" { - $CommandUnderTest | Should -HaveParameter Provider -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Provider -Type String -Mandatory:$false } It "Should have SingleItem as a parameter" { - $CommandUnderTest | Should -HaveParameter SingleItem -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SingleItem -Type Switch -Mandatory:$false } It "Should have NewChild as a parameter" { - $CommandUnderTest | Should -HaveParameter NewChild -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NewChild -Type Switch -Mandatory:$false } It "Should have Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } } diff --git a/tests/Restart-DbaService.Tests.ps1 b/tests/Restart-DbaService.Tests.ps1 index 593a318654..1d7619949c 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have InstanceName as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter InstanceName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InstanceName -Type String[] -Mandatory:$false } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Type as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Type -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have Timeout as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter Timeout -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Timeout -Type Int32 -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have Force as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Restore-DbaDatabase.Tests.ps1 b/tests/Restore-DbaDatabase.Tests.ps1 index 42b949ee47..b51323e689 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 -Not -Mandatory + $command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter -Mandatory:$false } It "Should have SqlCredential parameter" { - $command | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $command | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Path parameter" { - $command | Should -HaveParameter Path -Type Object[] -Not -Mandatory + $command | Should -HaveParameter Path -Type Object[] -Mandatory:$false } It "Should have DatabaseName parameter" { - $command | Should -HaveParameter DatabaseName -Type Object[] -Not -Mandatory + $command | Should -HaveParameter DatabaseName -Type Object[] -Mandatory:$false } It "Should have DestinationDataDirectory parameter" { - $command | Should -HaveParameter DestinationDataDirectory -Type String -Not -Mandatory + $command | Should -HaveParameter DestinationDataDirectory -Type String -Mandatory:$false } It "Should have DestinationLogDirectory parameter" { - $command | Should -HaveParameter DestinationLogDirectory -Type String -Not -Mandatory + $command | Should -HaveParameter DestinationLogDirectory -Type String -Mandatory:$false } It "Should have DestinationFileStreamDirectory parameter" { - $command | Should -HaveParameter DestinationFileStreamDirectory -Type String -Not -Mandatory + $command | Should -HaveParameter DestinationFileStreamDirectory -Type String -Mandatory:$false } It "Should have RestoreTime parameter" { - $command | Should -HaveParameter RestoreTime -Type DateTime -Not -Mandatory + $command | Should -HaveParameter RestoreTime -Type DateTime -Mandatory:$false } It "Should have NoRecovery parameter" { - $command | Should -HaveParameter NoRecovery -Type Switch -Not -Mandatory + $command | Should -HaveParameter NoRecovery -Type Switch -Mandatory:$false } It "Should have WithReplace parameter" { - $command | Should -HaveParameter WithReplace -Type Switch -Not -Mandatory + $command | Should -HaveParameter WithReplace -Type Switch -Mandatory:$false } It "Should have KeepReplication parameter" { - $command | Should -HaveParameter KeepReplication -Type Switch -Not -Mandatory + $command | Should -HaveParameter KeepReplication -Type Switch -Mandatory:$false } It "Should have XpDirTree parameter" { - $command | Should -HaveParameter XpDirTree -Type Switch -Not -Mandatory + $command | Should -HaveParameter XpDirTree -Type Switch -Mandatory:$false } It "Should have NoXpDirRecurse parameter" { - $command | Should -HaveParameter NoXpDirRecurse -Type Switch -Not -Mandatory + $command | Should -HaveParameter NoXpDirRecurse -Type Switch -Mandatory:$false } It "Should have OutputScriptOnly parameter" { - $command | Should -HaveParameter OutputScriptOnly -Type Switch -Not -Mandatory + $command | Should -HaveParameter OutputScriptOnly -Type Switch -Mandatory:$false } It "Should have VerifyOnly parameter" { - $command | Should -HaveParameter VerifyOnly -Type Switch -Not -Mandatory + $command | Should -HaveParameter VerifyOnly -Type Switch -Mandatory:$false } It "Should have MaintenanceSolutionBackup parameter" { - $command | Should -HaveParameter MaintenanceSolutionBackup -Type Switch -Not -Mandatory + $command | Should -HaveParameter MaintenanceSolutionBackup -Type Switch -Mandatory:$false } It "Should have FileMapping parameter" { - $command | Should -HaveParameter FileMapping -Type Hashtable -Not -Mandatory + $command | Should -HaveParameter FileMapping -Type Hashtable -Mandatory:$false } It "Should have IgnoreLogBackup parameter" { - $command | Should -HaveParameter IgnoreLogBackup -Type Switch -Not -Mandatory + $command | Should -HaveParameter IgnoreLogBackup -Type Switch -Mandatory:$false } It "Should have IgnoreDiffBackup parameter" { - $command | Should -HaveParameter IgnoreDiffBackup -Type Switch -Not -Mandatory + $command | Should -HaveParameter IgnoreDiffBackup -Type Switch -Mandatory:$false } It "Should have UseDestinationDefaultDirectories parameter" { - $command | Should -HaveParameter UseDestinationDefaultDirectories -Type Switch -Not -Mandatory + $command | Should -HaveParameter UseDestinationDefaultDirectories -Type Switch -Mandatory:$false } It "Should have ReuseSourceFolderStructure parameter" { - $command | Should -HaveParameter ReuseSourceFolderStructure -Type Switch -Not -Mandatory + $command | Should -HaveParameter ReuseSourceFolderStructure -Type Switch -Mandatory:$false } It "Should have DestinationFilePrefix parameter" { - $command | Should -HaveParameter DestinationFilePrefix -Type String -Not -Mandatory + $command | Should -HaveParameter DestinationFilePrefix -Type String -Mandatory:$false } It "Should have RestoredDatabaseNamePrefix parameter" { - $command | Should -HaveParameter RestoredDatabaseNamePrefix -Type String -Not -Mandatory + $command | Should -HaveParameter RestoredDatabaseNamePrefix -Type String -Mandatory:$false } It "Should have TrustDbBackupHistory parameter" { - $command | Should -HaveParameter TrustDbBackupHistory -Type Switch -Not -Mandatory + $command | Should -HaveParameter TrustDbBackupHistory -Type Switch -Mandatory:$false } It "Should have MaxTransferSize parameter" { - $command | Should -HaveParameter MaxTransferSize -Type Int32 -Not -Mandatory + $command | Should -HaveParameter MaxTransferSize -Type Int32 -Mandatory:$false } It "Should have BlockSize parameter" { - $command | Should -HaveParameter BlockSize -Type Int32 -Not -Mandatory + $command | Should -HaveParameter BlockSize -Type Int32 -Mandatory:$false } It "Should have BufferCount parameter" { - $command | Should -HaveParameter BufferCount -Type Int32 -Not -Mandatory + $command | Should -HaveParameter BufferCount -Type Int32 -Mandatory:$false } It "Should have DirectoryRecurse parameter" { - $command | Should -HaveParameter DirectoryRecurse -Type Switch -Not -Mandatory + $command | Should -HaveParameter DirectoryRecurse -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $command | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $command | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have StandbyDirectory parameter" { - $command | Should -HaveParameter StandbyDirectory -Type String -Not -Mandatory + $command | Should -HaveParameter StandbyDirectory -Type String -Mandatory:$false } It "Should have Continue parameter" { - $command | Should -HaveParameter Continue -Type Switch -Not -Mandatory + $command | Should -HaveParameter Continue -Type Switch -Mandatory:$false } It "Should have ExecuteAs parameter" { - $command | Should -HaveParameter ExecuteAs -Type String -Not -Mandatory + $command | Should -HaveParameter ExecuteAs -Type String -Mandatory:$false } It "Should have AzureCredential parameter" { - $command | Should -HaveParameter AzureCredential -Type String -Not -Mandatory + $command | Should -HaveParameter AzureCredential -Type String -Mandatory:$false } It "Should have ReplaceDbNameInFile parameter" { - $command | Should -HaveParameter ReplaceDbNameInFile -Type Switch -Not -Mandatory + $command | Should -HaveParameter ReplaceDbNameInFile -Type Switch -Mandatory:$false } It "Should have DestinationFileSuffix parameter" { - $command | Should -HaveParameter DestinationFileSuffix -Type String -Not -Mandatory + $command | Should -HaveParameter DestinationFileSuffix -Type String -Mandatory:$false } It "Should have Recover parameter" { - $command | Should -HaveParameter Recover -Type Switch -Not -Mandatory + $command | Should -HaveParameter Recover -Type Switch -Mandatory:$false } It "Should have KeepCDC parameter" { - $command | Should -HaveParameter KeepCDC -Type Switch -Not -Mandatory + $command | Should -HaveParameter KeepCDC -Type Switch -Mandatory:$false } It "Should have GetBackupInformation parameter" { - $command | Should -HaveParameter GetBackupInformation -Type String -Not -Mandatory + $command | Should -HaveParameter GetBackupInformation -Type String -Mandatory:$false } It "Should have StopAfterGetBackupInformation parameter" { - $command | Should -HaveParameter StopAfterGetBackupInformation -Type Switch -Not -Mandatory + $command | Should -HaveParameter StopAfterGetBackupInformation -Type Switch -Mandatory:$false } It "Should have SelectBackupInformation parameter" { - $command | Should -HaveParameter SelectBackupInformation -Type String -Not -Mandatory + $command | Should -HaveParameter SelectBackupInformation -Type String -Mandatory:$false } It "Should have StopAfterSelectBackupInformation parameter" { - $command | Should -HaveParameter StopAfterSelectBackupInformation -Type Switch -Not -Mandatory + $command | Should -HaveParameter StopAfterSelectBackupInformation -Type Switch -Mandatory:$false } It "Should have FormatBackupInformation parameter" { - $command | Should -HaveParameter FormatBackupInformation -Type String -Not -Mandatory + $command | Should -HaveParameter FormatBackupInformation -Type String -Mandatory:$false } It "Should have StopAfterFormatBackupInformation parameter" { - $command | Should -HaveParameter StopAfterFormatBackupInformation -Type Switch -Not -Mandatory + $command | Should -HaveParameter StopAfterFormatBackupInformation -Type Switch -Mandatory:$false } It "Should have TestBackupInformation parameter" { - $command | Should -HaveParameter TestBackupInformation -Type String -Not -Mandatory + $command | Should -HaveParameter TestBackupInformation -Type String -Mandatory:$false } It "Should have StopAfterTestBackupInformation parameter" { - $command | Should -HaveParameter StopAfterTestBackupInformation -Type Switch -Not -Mandatory + $command | Should -HaveParameter StopAfterTestBackupInformation -Type Switch -Mandatory:$false } It "Should have PageRestore parameter" { - $command | Should -HaveParameter PageRestore -Type Object -Not -Mandatory + $command | Should -HaveParameter PageRestore -Type Object -Mandatory:$false } It "Should have PageRestoreTailFolder parameter" { - $command | Should -HaveParameter PageRestoreTailFolder -Type String -Not -Mandatory + $command | Should -HaveParameter PageRestoreTailFolder -Type String -Mandatory:$false } It "Should have StopBefore parameter" { - $command | Should -HaveParameter StopBefore -Type Switch -Not -Mandatory + $command | Should -HaveParameter StopBefore -Type Switch -Mandatory:$false } It "Should have StopMark parameter" { - $command | Should -HaveParameter StopMark -Type String -Not -Mandatory + $command | Should -HaveParameter StopMark -Type String -Mandatory:$false } It "Should have StopAfterDate parameter" { - $command | Should -HaveParameter StopAfterDate -Type DateTime -Not -Mandatory + $command | Should -HaveParameter StopAfterDate -Type DateTime -Mandatory:$false } It "Should have StatementTimeout parameter" { - $command | Should -HaveParameter StatementTimeout -Type Int32 -Not -Mandatory + $command | Should -HaveParameter StatementTimeout -Type Int32 -Mandatory:$false } } } diff --git a/tests/Resume-DbaAgDbDataMovement.Tests.ps1 b/tests/Resume-DbaAgDbDataMovement.Tests.ps1 index 3d49655f78..77a3c0c69a 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have AvailabilityGroup parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type AvailabilityDatabase[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type AvailabilityDatabase[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Save-DbaCommunitySoftware.Tests.ps1 b/tests/Save-DbaCommunitySoftware.Tests.ps1 index f18c8da6ed..253a13f060 100644 --- a/tests/Save-DbaCommunitySoftware.Tests.ps1 +++ b/tests/Save-DbaCommunitySoftware.Tests.ps1 @@ -12,22 +12,22 @@ Describe "Save-DbaCommunitySoftware" { $CommandUnderTest = Get-Command Save-DbaCommunitySoftware } It "Should have Software as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Software -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Software -Type String -Mandatory:$false } It "Should have Branch as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Branch -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Branch -Type String -Mandatory:$false } It "Should have LocalFile as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter LocalFile -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LocalFile -Type String -Mandatory:$false } It "Should have Url as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Url -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Url -Type String -Mandatory:$false } It "Should have LocalDirectory as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter LocalDirectory -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LocalDirectory -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Save-DbaDiagnosticQueryScript.Tests.ps1 b/tests/Save-DbaDiagnosticQueryScript.Tests.ps1 index 4d6c890d6f..749de4924e 100644 --- a/tests/Save-DbaDiagnosticQueryScript.Tests.ps1 +++ b/tests/Save-DbaDiagnosticQueryScript.Tests.ps1 @@ -12,46 +12,46 @@ Describe "Save-DbaDiagnosticQueryScript" { $CommandUnderTest = Get-Command Save-DbaDiagnosticQueryScript } It "Should have Path as a non-mandatory parameter of type FileInfo" { - $CommandUnderTest | Should -HaveParameter Path -Type FileInfo -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type FileInfo -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory parameter of type ActionPreference" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Save-DbaKbUpdate.Tests.ps1 b/tests/Save-DbaKbUpdate.Tests.ps1 index 6e302c5c50..1cf3ef5315 100644 --- a/tests/Save-DbaKbUpdate.Tests.ps1 +++ b/tests/Save-DbaKbUpdate.Tests.ps1 @@ -11,25 +11,25 @@ Describe "Save-DbaKbUpdate" { $CommandUnderTest = Get-Command Save-DbaKbUpdate } It "Should have Name as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String[] -Mandatory:$false } It "Should have Path as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have FilePath as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter FilePath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilePath -Type String -Mandatory:$false } It "Should have Architecture as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Architecture -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Architecture -Type String -Mandatory:$false } It "Should have Language as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Language -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Language -Type String -Mandatory:$false } It "Should have InputObject as a non-mandatory Object[] parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Select-DbaBackupInformation.Tests.ps1 b/tests/Select-DbaBackupInformation.Tests.ps1 index 98e0cfd7fe..3b9de8cc25 100644 --- a/tests/Select-DbaBackupInformation.Tests.ps1 +++ b/tests/Select-DbaBackupInformation.Tests.ps1 @@ -12,31 +12,31 @@ Describe "Select-DbaBackupInformation" { $CommandUnderTest = Get-Command Select-DbaBackupInformation } It "Should have BackupHistory as a non-mandatory parameter of type Object" { - $CommandUnderTest | Should -HaveParameter BackupHistory -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter BackupHistory -Type Object -Mandatory:$false } It "Should have RestoreTime as a non-mandatory parameter of type DateTime" { - $CommandUnderTest | Should -HaveParameter RestoreTime -Type DateTime -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RestoreTime -Type DateTime -Mandatory:$false } It "Should have IgnoreLogs as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreLogs -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IgnoreLogs -Type Switch -Mandatory:$false } It "Should have IgnoreDiffs as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreDiffs -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IgnoreDiffs -Type Switch -Mandatory:$false } It "Should have DatabaseName as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter DatabaseName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DatabaseName -Type String[] -Mandatory:$false } It "Should have ServerName as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter ServerName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ServerName -Type String[] -Mandatory:$false } It "Should have ContinuePoints as a non-mandatory parameter of type Object" { - $CommandUnderTest | Should -HaveParameter ContinuePoints -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ContinuePoints -Type Object -Mandatory:$false } It "Should have LastRestoreType as a non-mandatory parameter of type Object" { - $CommandUnderTest | Should -HaveParameter LastRestoreType -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LastRestoreType -Type Object -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Set-DbaAgentJobCategory.Tests.ps1 b/tests/Set-DbaAgentJobCategory.Tests.ps1 index c0d0d3b20d..a5ed4112a6 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 DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Category as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Category -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Category -Type String[] -Mandatory:$false } It "Should have NewName as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter NewName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NewName -Type String[] -Mandatory:$false } It "Should have Force as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Set-DbaAgentSchedule.Tests.ps1 b/tests/Set-DbaAgentSchedule.Tests.ps1 index d2890c6d7b..fc79696bff 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Job parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Job -Type Object[] -Mandatory:$false } It "Should have ScheduleName parameter" { - $CommandUnderTest | Should -HaveParameter ScheduleName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ScheduleName -Type String -Mandatory:$false } It "Should have NewName parameter" { - $CommandUnderTest | Should -HaveParameter NewName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NewName -Type String -Mandatory:$false } It "Should have Enabled parameter" { - $CommandUnderTest | Should -HaveParameter Enabled -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Enabled -Type Switch -Mandatory:$false } It "Should have Disabled parameter" { - $CommandUnderTest | Should -HaveParameter Disabled -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Disabled -Type Switch -Mandatory:$false } It "Should have FrequencyType parameter" { - $CommandUnderTest | Should -HaveParameter FrequencyType -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FrequencyType -Type Object -Mandatory:$false } It "Should have FrequencyInterval parameter" { - $CommandUnderTest | Should -HaveParameter FrequencyInterval -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FrequencyInterval -Type Object[] -Mandatory:$false } It "Should have FrequencySubdayType parameter" { - $CommandUnderTest | Should -HaveParameter FrequencySubdayType -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FrequencySubdayType -Type Object -Mandatory:$false } It "Should have FrequencySubdayInterval parameter" { - $CommandUnderTest | Should -HaveParameter FrequencySubdayInterval -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FrequencySubdayInterval -Type Int32 -Mandatory:$false } It "Should have FrequencyRelativeInterval parameter" { - $CommandUnderTest | Should -HaveParameter FrequencyRelativeInterval -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FrequencyRelativeInterval -Type Object -Mandatory:$false } It "Should have FrequencyRecurrenceFactor parameter" { - $CommandUnderTest | Should -HaveParameter FrequencyRecurrenceFactor -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FrequencyRecurrenceFactor -Type Int32 -Mandatory:$false } It "Should have StartDate parameter" { - $CommandUnderTest | Should -HaveParameter StartDate -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter StartDate -Type String -Mandatory:$false } It "Should have EndDate parameter" { - $CommandUnderTest | Should -HaveParameter EndDate -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EndDate -Type String -Mandatory:$false } It "Should have StartTime parameter" { - $CommandUnderTest | Should -HaveParameter StartTime -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter StartTime -Type String -Mandatory:$false } It "Should have EndTime parameter" { - $CommandUnderTest | Should -HaveParameter EndTime -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EndTime -Type String -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Force parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } } diff --git a/tests/Set-DbaAgentServer.Tests.ps1 b/tests/Set-DbaAgentServer.Tests.ps1 index 349df96d1a..f171f0ca69 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type JobServer[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type JobServer[] -Mandatory:$false } It "Should have AgentLogLevel as a parameter" { - $CommandUnderTest | Should -HaveParameter AgentLogLevel -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AgentLogLevel -Type Object -Mandatory:$false } It "Should have AgentMailType as a parameter" { - $CommandUnderTest | Should -HaveParameter AgentMailType -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AgentMailType -Type Object -Mandatory:$false } It "Should have AgentShutdownWaitTime as a parameter" { - $CommandUnderTest | Should -HaveParameter AgentShutdownWaitTime -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AgentShutdownWaitTime -Type Int32 -Mandatory:$false } It "Should have DatabaseMailProfile as a parameter" { - $CommandUnderTest | Should -HaveParameter DatabaseMailProfile -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DatabaseMailProfile -Type String -Mandatory:$false } It "Should have ErrorLogFile as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorLogFile -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorLogFile -Type String -Mandatory:$false } It "Should have IdleCpuDuration as a parameter" { - $CommandUnderTest | Should -HaveParameter IdleCpuDuration -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IdleCpuDuration -Type Int32 -Mandatory:$false } It "Should have IdleCpuPercentage as a parameter" { - $CommandUnderTest | Should -HaveParameter IdleCpuPercentage -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IdleCpuPercentage -Type Int32 -Mandatory:$false } It "Should have CpuPolling as a parameter" { - $CommandUnderTest | Should -HaveParameter CpuPolling -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CpuPolling -Type String -Mandatory:$false } It "Should have LocalHostAlias as a parameter" { - $CommandUnderTest | Should -HaveParameter LocalHostAlias -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LocalHostAlias -Type String -Mandatory:$false } It "Should have LoginTimeout as a parameter" { - $CommandUnderTest | Should -HaveParameter LoginTimeout -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LoginTimeout -Type Int32 -Mandatory:$false } It "Should have MaximumHistoryRows as a parameter" { - $CommandUnderTest | Should -HaveParameter MaximumHistoryRows -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaximumHistoryRows -Type Int32 -Mandatory:$false } It "Should have MaximumJobHistoryRows as a parameter" { - $CommandUnderTest | Should -HaveParameter MaximumJobHistoryRows -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaximumJobHistoryRows -Type Int32 -Mandatory:$false } It "Should have NetSendRecipient as a parameter" { - $CommandUnderTest | Should -HaveParameter NetSendRecipient -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NetSendRecipient -Type String -Mandatory:$false } It "Should have ReplaceAlertTokens as a parameter" { - $CommandUnderTest | Should -HaveParameter ReplaceAlertTokens -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ReplaceAlertTokens -Type String -Mandatory:$false } It "Should have SaveInSentFolder as a parameter" { - $CommandUnderTest | Should -HaveParameter SaveInSentFolder -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SaveInSentFolder -Type String -Mandatory:$false } It "Should have SqlAgentAutoStart as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlAgentAutoStart -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlAgentAutoStart -Type String -Mandatory:$false } It "Should have SqlAgentMailProfile as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlAgentMailProfile -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlAgentMailProfile -Type String -Mandatory:$false } It "Should have SqlAgentRestart as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlAgentRestart -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlAgentRestart -Type String -Mandatory:$false } It "Should have SqlServerRestart as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlServerRestart -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlServerRestart -Type String -Mandatory:$false } It "Should have WriteOemErrorLog as a parameter" { - $CommandUnderTest | Should -HaveParameter WriteOemErrorLog -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WriteOemErrorLog -Type String -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Set-DbaCmConnection.Tests.ps1 b/tests/Set-DbaCmConnection.Tests.ps1 index eade8a01d4..6cc2208eb3 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 DbaCmConnectionParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaCmConnectionParameter[] -Mandatory:$false } It "Should have Credential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have UseWindowsCredentials parameter" { - $CommandUnderTest | Should -HaveParameter UseWindowsCredentials -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter UseWindowsCredentials -Type Switch -Mandatory:$false } It "Should have OverrideExplicitCredential parameter" { - $CommandUnderTest | Should -HaveParameter OverrideExplicitCredential -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OverrideExplicitCredential -Type Switch -Mandatory:$false } It "Should have OverrideConnectionPolicy parameter" { - $CommandUnderTest | Should -HaveParameter OverrideConnectionPolicy -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OverrideConnectionPolicy -Type Switch -Mandatory:$false } It "Should have DisabledConnectionTypes parameter" { - $CommandUnderTest | Should -HaveParameter DisabledConnectionTypes -Type ManagementConnectionType -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DisabledConnectionTypes -Type ManagementConnectionType -Mandatory:$false } It "Should have DisableBadCredentialCache parameter" { - $CommandUnderTest | Should -HaveParameter DisableBadCredentialCache -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DisableBadCredentialCache -Type Switch -Mandatory:$false } It "Should have DisableCimPersistence parameter" { - $CommandUnderTest | Should -HaveParameter DisableCimPersistence -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DisableCimPersistence -Type Switch -Mandatory:$false } It "Should have DisableCredentialAutoRegister parameter" { - $CommandUnderTest | Should -HaveParameter DisableCredentialAutoRegister -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DisableCredentialAutoRegister -Type Switch -Mandatory:$false } It "Should have EnableCredentialFailover parameter" { - $CommandUnderTest | Should -HaveParameter EnableCredentialFailover -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableCredentialFailover -Type Switch -Mandatory:$false } It "Should have WindowsCredentialsAreBad parameter" { - $CommandUnderTest | Should -HaveParameter WindowsCredentialsAreBad -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WindowsCredentialsAreBad -Type Switch -Mandatory:$false } It "Should have CimWinRMOptions parameter" { - $CommandUnderTest | Should -HaveParameter CimWinRMOptions -Type WSManSessionOptions -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CimWinRMOptions -Type WSManSessionOptions -Mandatory:$false } It "Should have CimDCOMOptions parameter" { - $CommandUnderTest | Should -HaveParameter CimDCOMOptions -Type DComSessionOptions -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CimDCOMOptions -Type DComSessionOptions -Mandatory:$false } It "Should have AddBadCredential parameter" { - $CommandUnderTest | Should -HaveParameter AddBadCredential -Type PSCredential[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AddBadCredential -Type PSCredential[] -Mandatory:$false } It "Should have RemoveBadCredential parameter" { - $CommandUnderTest | Should -HaveParameter RemoveBadCredential -Type PSCredential[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RemoveBadCredential -Type PSCredential[] -Mandatory:$false } It "Should have ClearBadCredential parameter" { - $CommandUnderTest | Should -HaveParameter ClearBadCredential -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ClearBadCredential -Type Switch -Mandatory:$false } It "Should have ClearCredential parameter" { - $CommandUnderTest | Should -HaveParameter ClearCredential -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ClearCredential -Type Switch -Mandatory:$false } It "Should have ResetCredential parameter" { - $CommandUnderTest | Should -HaveParameter ResetCredential -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ResetCredential -Type Switch -Mandatory:$false } It "Should have ResetConnectionStatus parameter" { - $CommandUnderTest | Should -HaveParameter ResetConnectionStatus -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ResetConnectionStatus -Type Switch -Mandatory:$false } It "Should have ResetConfiguration parameter" { - $CommandUnderTest | Should -HaveParameter ResetConfiguration -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ResetConfiguration -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Set-DbaDbFileGroup.Tests.ps1 b/tests/Set-DbaDbFileGroup.Tests.ps1 index c18898d443..e51b558d92 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have FileGroup as a parameter" { - $CommandUnderTest | Should -HaveParameter FileGroup -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FileGroup -Type String[] -Mandatory:$false } It "Should have Default as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Default -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Default -Type Switch -Mandatory:$false } It "Should have ReadOnly as a switch parameter" { - $CommandUnderTest | Should -HaveParameter ReadOnly -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ReadOnly -Type Switch -Mandatory:$false } It "Should have AutoGrowAllFiles as a switch parameter" { - $CommandUnderTest | Should -HaveParameter AutoGrowAllFiles -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AutoGrowAllFiles -Type Switch -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Set-DbaDbMirror.Tests.ps1 b/tests/Set-DbaDbMirror.Tests.ps1 index aebad9e9dd..2f3debf396 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have Partner parameter" { - $CommandUnderTest | Should -HaveParameter Partner -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Partner -Type String -Mandatory:$false } It "Should have Witness parameter" { - $CommandUnderTest | Should -HaveParameter Witness -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Witness -Type String -Mandatory:$false } It "Should have SafetyLevel parameter" { - $CommandUnderTest | Should -HaveParameter SafetyLevel -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SafetyLevel -Type String -Mandatory:$false } It "Should have State parameter" { - $CommandUnderTest | Should -HaveParameter State -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter State -Type String -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Set-DbaDbOwner.Tests.ps1 b/tests/Set-DbaDbOwner.Tests.ps1 index 4e8e548517..0389ae7bdd 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have TargetLogin parameter" { - $CommandUnderTest | Should -HaveParameter TargetLogin -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter TargetLogin -Type String -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Set-DbaDbQueryStoreOption.Tests.ps1 b/tests/Set-DbaDbQueryStoreOption.Tests.ps1 index 07db9d3edc..ab771610cc 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have AllDatabases parameter" { - $CommandUnderTest | Should -HaveParameter AllDatabases -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AllDatabases -Type Switch -Mandatory:$false } It "Should have State parameter" { - $CommandUnderTest | Should -HaveParameter State -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter State -Type String[] -Mandatory:$false } It "Should have FlushInterval parameter" { - $CommandUnderTest | Should -HaveParameter FlushInterval -Type Int64 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FlushInterval -Type Int64 -Mandatory:$false } It "Should have CollectionInterval parameter" { - $CommandUnderTest | Should -HaveParameter CollectionInterval -Type Int64 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CollectionInterval -Type Int64 -Mandatory:$false } It "Should have MaxSize parameter" { - $CommandUnderTest | Should -HaveParameter MaxSize -Type Int64 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaxSize -Type Int64 -Mandatory:$false } It "Should have CaptureMode parameter" { - $CommandUnderTest | Should -HaveParameter CaptureMode -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CaptureMode -Type String[] -Mandatory:$false } It "Should have CleanupMode parameter" { - $CommandUnderTest | Should -HaveParameter CleanupMode -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CleanupMode -Type String[] -Mandatory:$false } It "Should have StaleQueryThreshold parameter" { - $CommandUnderTest | Should -HaveParameter StaleQueryThreshold -Type Int64 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter StaleQueryThreshold -Type Int64 -Mandatory:$false } It "Should have MaxPlansPerQuery parameter" { - $CommandUnderTest | Should -HaveParameter MaxPlansPerQuery -Type Int64 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaxPlansPerQuery -Type Int64 -Mandatory:$false } It "Should have WaitStatsCaptureMode parameter" { - $CommandUnderTest | Should -HaveParameter WaitStatsCaptureMode -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WaitStatsCaptureMode -Type String[] -Mandatory:$false } It "Should have CustomCapturePolicyExecutionCount parameter" { - $CommandUnderTest | Should -HaveParameter CustomCapturePolicyExecutionCount -Type Int64 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CustomCapturePolicyExecutionCount -Type Int64 -Mandatory:$false } It "Should have CustomCapturePolicyTotalCompileCPUTimeMS parameter" { - $CommandUnderTest | Should -HaveParameter CustomCapturePolicyTotalCompileCPUTimeMS -Type Int64 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CustomCapturePolicyTotalCompileCPUTimeMS -Type Int64 -Mandatory:$false } It "Should have CustomCapturePolicyTotalExecutionCPUTimeMS parameter" { - $CommandUnderTest | Should -HaveParameter CustomCapturePolicyTotalExecutionCPUTimeMS -Type Int64 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CustomCapturePolicyTotalExecutionCPUTimeMS -Type Int64 -Mandatory:$false } It "Should have CustomCapturePolicyStaleThresholdHours parameter" { - $CommandUnderTest | Should -HaveParameter CustomCapturePolicyStaleThresholdHours -Type Int64 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CustomCapturePolicyStaleThresholdHours -Type Int64 -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Set-DbaDbRecoveryModel.Tests.ps1 b/tests/Set-DbaDbRecoveryModel.Tests.ps1 index fcbf4c35fd..e570213bce 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have RecoveryModel parameter" { - $CommandUnderTest | Should -HaveParameter RecoveryModel -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RecoveryModel -Type String -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have AllDatabases parameter" { - $CommandUnderTest | Should -HaveParameter AllDatabases -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AllDatabases -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } } diff --git a/tests/Set-DbaDefaultPath.Tests.ps1 b/tests/Set-DbaDefaultPath.Tests.ps1 index 89d519ab38..1c06a31cfe 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Type as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Type -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String[] -Mandatory:$false } It "Should have Path as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Set-DbaLogin.Tests.ps1 b/tests/Set-DbaLogin.Tests.ps1 index 2e885ea201..298e5e96a9 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 DbaInstanceParameter[] -Not -Mandatory - $command | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory - $command | Should -HaveParameter Login -Type String[] -Not -Mandatory - $command | Should -HaveParameter SecurePassword -Type Object -Not -Mandatory - $command | Should -HaveParameter DefaultDatabase -Type String -Not -Mandatory - $command | Should -HaveParameter Unlock -Type Switch -Not -Mandatory - $command | Should -HaveParameter PasswordMustChange -Type Switch -Not -Mandatory - $command | Should -HaveParameter NewName -Type String -Not -Mandatory - $command | Should -HaveParameter Disable -Type Switch -Not -Mandatory - $command | Should -HaveParameter Enable -Type Switch -Not -Mandatory - $command | Should -HaveParameter DenyLogin -Type Switch -Not -Mandatory - $command | Should -HaveParameter GrantLogin -Type Switch -Not -Mandatory - $command | Should -HaveParameter PasswordPolicyEnforced -Type Switch -Not -Mandatory - $command | Should -HaveParameter PasswordExpirationEnabled -Type Switch -Not -Mandatory - $command | Should -HaveParameter AddRole -Type String[] -Not -Mandatory - $command | Should -HaveParameter RemoveRole -Type String[] -Not -Mandatory - $command | Should -HaveParameter InputObject -Type Login[] -Not -Mandatory - $command | Should -HaveParameter Force -Type Switch -Not -Mandatory - $command | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $command | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false + $command | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false + $command | Should -HaveParameter Login -Type String[] -Mandatory:$false + $command | Should -HaveParameter SecurePassword -Type Object -Mandatory:$false + $command | Should -HaveParameter DefaultDatabase -Type String -Mandatory:$false + $command | Should -HaveParameter Unlock -Type Switch -Mandatory:$false + $command | Should -HaveParameter PasswordMustChange -Type Switch -Mandatory:$false + $command | Should -HaveParameter NewName -Type String -Mandatory:$false + $command | Should -HaveParameter Disable -Type Switch -Mandatory:$false + $command | Should -HaveParameter Enable -Type Switch -Mandatory:$false + $command | Should -HaveParameter DenyLogin -Type Switch -Mandatory:$false + $command | Should -HaveParameter GrantLogin -Type Switch -Mandatory:$false + $command | Should -HaveParameter PasswordPolicyEnforced -Type Switch -Mandatory:$false + $command | Should -HaveParameter PasswordExpirationEnabled -Type Switch -Mandatory:$false + $command | Should -HaveParameter AddRole -Type String[] -Mandatory:$false + $command | Should -HaveParameter RemoveRole -Type String[] -Mandatory:$false + $command | Should -HaveParameter InputObject -Type Login[] -Mandatory:$false + $command | Should -HaveParameter Force -Type Switch -Mandatory:$false + $command | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Validates -AddRole contains <_>" -ForEach $systemRoles { diff --git a/tests/Set-DbaMaxDop.Tests.ps1 b/tests/Set-DbaMaxDop.Tests.ps1 index e31eb25db5..3743f0dcad 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have MaxDop parameter" { - $CommandUnderTest | Should -HaveParameter MaxDop -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaxDop -Type Int32 -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject -Mandatory:$false } It "Should have AllDatabases parameter" { - $CommandUnderTest | Should -HaveParameter AllDatabases -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AllDatabases -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Set-DbaMaxMemory.Tests.ps1 b/tests/Set-DbaMaxMemory.Tests.ps1 index 5f8626da92..057b3cd9b0 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Max parameter" { - $CommandUnderTest | Should -HaveParameter Max -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Max -Type Int32 -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type PSObject[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Set-DbaNetworkConfiguration.Tests.ps1 b/tests/Set-DbaNetworkConfiguration.Tests.ps1 index 956388ca4e..27de72a0dd 100644 --- a/tests/Set-DbaNetworkConfiguration.Tests.ps1 +++ b/tests/Set-DbaNetworkConfiguration.Tests.ps1 @@ -10,34 +10,34 @@ Describe "Set-DbaNetworkConfiguration" { $CommandUnderTest = Get-Command Set-DbaNetworkConfiguration } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableProtocol as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter EnableProtocol -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableProtocol -Type String -Mandatory:$false } It "Should have DisableProtocol as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter DisableProtocol -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DisableProtocol -Type String -Mandatory:$false } It "Should have DynamicPortForIPAll as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter DynamicPortForIPAll -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DynamicPortForIPAll -Type Switch -Mandatory:$false } It "Should have StaticPortForIPAll as a non-mandatory parameter of type Int32[]" { - $CommandUnderTest | Should -HaveParameter StaticPortForIPAll -Type Int32[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter StaticPortForIPAll -Type Int32[] -Mandatory:$false } It "Should have IpAddress as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter IpAddress -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IpAddress -Type String[] -Mandatory:$false } It "Should have RestartService as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter RestartService -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RestartService -Type Switch -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Set-DbaRgResourcePool.Tests.ps1 b/tests/Set-DbaRgResourcePool.Tests.ps1 index a12c6986a2..5d32e839f4 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have ResourcePool parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePool -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ResourcePool -Type String[] -Mandatory:$false } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String -Mandatory:$false } It "Should have MinimumCpuPercentage parameter" { - $CommandUnderTest | Should -HaveParameter MinimumCpuPercentage -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MinimumCpuPercentage -Type Int32 -Mandatory:$false } It "Should have MaximumCpuPercentage parameter" { - $CommandUnderTest | Should -HaveParameter MaximumCpuPercentage -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaximumCpuPercentage -Type Int32 -Mandatory:$false } It "Should have CapCpuPercentage parameter" { - $CommandUnderTest | Should -HaveParameter CapCpuPercentage -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CapCpuPercentage -Type Int32 -Mandatory:$false } It "Should have MinimumMemoryPercentage parameter" { - $CommandUnderTest | Should -HaveParameter MinimumMemoryPercentage -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MinimumMemoryPercentage -Type Int32 -Mandatory:$false } It "Should have MaximumMemoryPercentage parameter" { - $CommandUnderTest | Should -HaveParameter MaximumMemoryPercentage -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaximumMemoryPercentage -Type Int32 -Mandatory:$false } It "Should have MinimumIOPSPerVolume parameter" { - $CommandUnderTest | Should -HaveParameter MinimumIOPSPerVolume -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MinimumIOPSPerVolume -Type Int32 -Mandatory:$false } It "Should have MaximumIOPSPerVolume parameter" { - $CommandUnderTest | Should -HaveParameter MaximumIOPSPerVolume -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaximumIOPSPerVolume -Type Int32 -Mandatory:$false } It "Should have MaximumProcesses parameter" { - $CommandUnderTest | Should -HaveParameter MaximumProcesses -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaximumProcesses -Type Int32 -Mandatory:$false } It "Should have SkipReconfigure parameter" { - $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type Switch -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Set-DbaRgWorkloadGroup.Tests.ps1 b/tests/Set-DbaRgWorkloadGroup.Tests.ps1 index 4586bcdd55..0062129aed 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have WorkloadGroup parameter" { - $CommandUnderTest | Should -HaveParameter WorkloadGroup -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WorkloadGroup -Type String[] -Mandatory:$false } It "Should have ResourcePool parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePool -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ResourcePool -Type String -Mandatory:$false } It "Should have ResourcePoolType parameter" { - $CommandUnderTest | Should -HaveParameter ResourcePoolType -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ResourcePoolType -Type String -Mandatory:$false } It "Should have Importance parameter" { - $CommandUnderTest | Should -HaveParameter Importance -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Importance -Type String -Mandatory:$false } It "Should have RequestMaximumMemoryGrantPercentage parameter" { - $CommandUnderTest | Should -HaveParameter RequestMaximumMemoryGrantPercentage -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RequestMaximumMemoryGrantPercentage -Type Int32 -Mandatory:$false } It "Should have RequestMaximumCpuTimeInSeconds parameter" { - $CommandUnderTest | Should -HaveParameter RequestMaximumCpuTimeInSeconds -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RequestMaximumCpuTimeInSeconds -Type Int32 -Mandatory:$false } It "Should have RequestMemoryGrantTimeoutInSeconds parameter" { - $CommandUnderTest | Should -HaveParameter RequestMemoryGrantTimeoutInSeconds -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter RequestMemoryGrantTimeoutInSeconds -Type Int32 -Mandatory:$false } It "Should have MaximumDegreeOfParallelism parameter" { - $CommandUnderTest | Should -HaveParameter MaximumDegreeOfParallelism -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaximumDegreeOfParallelism -Type Int32 -Mandatory:$false } It "Should have GroupMaximumRequests parameter" { - $CommandUnderTest | Should -HaveParameter GroupMaximumRequests -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter GroupMaximumRequests -Type Int32 -Mandatory:$false } It "Should have SkipReconfigure parameter" { - $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SkipReconfigure -Type Switch -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type WorkloadGroup[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type WorkloadGroup[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Set-DbatoolsConfig.Tests.ps1 b/tests/Set-DbatoolsConfig.Tests.ps1 index aa8b5aeb0b..84b30e876a 100644 --- a/tests/Set-DbatoolsConfig.Tests.ps1 +++ b/tests/Set-DbatoolsConfig.Tests.ps1 @@ -6,61 +6,61 @@ Describe "Set-DbatoolsConfig" { $CommandUnderTest = Get-Command Set-DbatoolsConfig } It "Should have FullName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter FullName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FullName -Type String -Mandatory:$false } It "Should have Module as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Module -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Module -Type String -Mandatory:$false } It "Should have Name as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String -Mandatory:$false } It "Should have Value as a non-mandatory Object parameter" { - $CommandUnderTest | Should -HaveParameter Value -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Value -Type Object -Mandatory:$false } It "Should have PersistedValue as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter PersistedValue -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PersistedValue -Type String -Mandatory:$false } It "Should have PersistedType as a non-mandatory ConfigurationValueType parameter" { - $CommandUnderTest | Should -HaveParameter PersistedType -Type ConfigurationValueType -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PersistedType -Type ConfigurationValueType -Mandatory:$false } It "Should have Description as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Description -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Description -Type String -Mandatory:$false } It "Should have Validation as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Validation -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Validation -Type String -Mandatory:$false } It "Should have Handler as a non-mandatory ScriptBlock parameter" { - $CommandUnderTest | Should -HaveParameter Handler -Type ScriptBlock -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Handler -Type ScriptBlock -Mandatory:$false } It "Should have Hidden as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Hidden -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Hidden -Type Switch -Mandatory:$false } It "Should have Default as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Default -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Default -Type Switch -Mandatory:$false } It "Should have Initialize as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Initialize -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Initialize -Type Switch -Mandatory:$false } It "Should have SimpleExport as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter SimpleExport -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SimpleExport -Type Switch -Mandatory:$false } It "Should have ModuleExport as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter ModuleExport -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ModuleExport -Type Switch -Mandatory:$false } It "Should have DisableValidation as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter DisableValidation -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DisableValidation -Type Switch -Mandatory:$false } It "Should have DisableHandler as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter DisableHandler -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DisableHandler -Type Switch -Mandatory:$false } It "Should have PassThru as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter PassThru -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PassThru -Type Switch -Mandatory:$false } It "Should have Register as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Register -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Register -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Set-DbatoolsInsecureConnection.Tests.ps1 b/tests/Set-DbatoolsInsecureConnection.Tests.ps1 index b760da9c07..9509c49424 100644 --- a/tests/Set-DbatoolsInsecureConnection.Tests.ps1 +++ b/tests/Set-DbatoolsInsecureConnection.Tests.ps1 @@ -12,49 +12,49 @@ Describe "Set-DbatoolsInsecureConnection" { $CommandUnderTest = Get-Command Set-DbatoolsInsecureConnection } It "Should have SessionOnly as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter SessionOnly -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SessionOnly -Type Switch -Mandatory:$false } It "Should have Scope as a non-mandatory ConfigScope parameter" { - $CommandUnderTest | Should -HaveParameter Scope -Type ConfigScope -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Scope -Type ConfigScope -Mandatory:$false } It "Should have Register as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Register -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Register -Type Switch -Mandatory:$false } It "Should have Verbose as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory ActionPreference parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory ActionPreference parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory ActionPreference parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory ActionPreference parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Set-DbatoolsPath.Tests.ps1 b/tests/Set-DbatoolsPath.Tests.ps1 index ceb0598c2f..ab99f5da2b 100644 --- a/tests/Set-DbatoolsPath.Tests.ps1 +++ b/tests/Set-DbatoolsPath.Tests.ps1 @@ -12,52 +12,52 @@ Describe "Set-DbatoolsPath" { $CommandUnderTest = Get-Command Set-DbatoolsPath } It "Should have Name as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String -Mandatory:$false } It "Should have Path as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have Register as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Register -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Register -Type Switch -Mandatory:$false } It "Should have Scope as a non-mandatory ConfigScope parameter" { - $CommandUnderTest | Should -HaveParameter Scope -Type ConfigScope -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Scope -Type ConfigScope -Mandatory:$false } It "Should have Verbose as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction as a non-mandatory ActionPreference parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction as a non-mandatory ActionPreference parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction as a non-mandatory ActionPreference parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction as a non-mandatory ActionPreference parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } } diff --git a/tests/Start-DbaPfDataCollectorSet.Tests.ps1 b/tests/Start-DbaPfDataCollectorSet.Tests.ps1 index 6d0e4e855b..ab7a6f6795 100644 --- a/tests/Start-DbaPfDataCollectorSet.Tests.ps1 +++ b/tests/Start-DbaPfDataCollectorSet.Tests.ps1 @@ -6,22 +6,22 @@ Describe "Start-DbaPfDataCollectorSet" { $CommandUnderTest = Get-Command Start-DbaPfDataCollectorSet } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have CollectorSet as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter CollectorSet -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CollectorSet -Type String[] -Mandatory:$false } It "Should have InputObject as a non-mandatory parameter of type Object[]" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have NoWait as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter NoWait -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoWait -Type Switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Start-DbaService.Tests.ps1 b/tests/Start-DbaService.Tests.ps1 index fef1947212..8efb10aeda 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have InstanceName parameter" { - $CommandUnderTest | Should -HaveParameter InstanceName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InstanceName -Type String[] -Mandatory:$false } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Type parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String[] -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have Timeout parameter" { - $CommandUnderTest | Should -HaveParameter Timeout -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Timeout -Type Int32 -Mandatory:$false } It "Should have Credential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Start-DbaXESmartTarget.Tests.ps1 b/tests/Start-DbaXESmartTarget.Tests.ps1 index 0f5aefea03..8eed328bef 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String -Mandatory:$false } It "Should have Session parameter" { - $CommandUnderTest | Should -HaveParameter Session -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Session -Type String -Mandatory:$false } It "Should have FailOnProcessingError parameter" { - $CommandUnderTest | Should -HaveParameter FailOnProcessingError -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FailOnProcessingError -Type Switch -Mandatory:$false } It "Should have Responder parameter" { - $CommandUnderTest | Should -HaveParameter Responder -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Responder -Type Object[] -Mandatory:$false } It "Should have Template parameter" { - $CommandUnderTest | Should -HaveParameter Template -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Template -Type String[] -Mandatory:$false } It "Should have NotAsJob parameter" { - $CommandUnderTest | Should -HaveParameter NotAsJob -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NotAsJob -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Stop-DbaDbEncryption.Tests.ps1 b/tests/Stop-DbaDbEncryption.Tests.ps1 index 8c38da58e2..e2dae2c206 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Stop-DbaExternalProcess.Tests.ps1 b/tests/Stop-DbaExternalProcess.Tests.ps1 index fbfefcb853..0872db2734 100644 --- a/tests/Stop-DbaExternalProcess.Tests.ps1 +++ b/tests/Stop-DbaExternalProcess.Tests.ps1 @@ -6,16 +6,16 @@ Describe "Stop-DbaExternalProcess" { $CommandUnderTest = Get-Command Stop-DbaExternalProcess } It "Should have ComputerName as a non-mandatory DbaInstanceParameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter -Mandatory:$false } It "Should have Credential as a non-mandatory PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have ProcessId as a non-mandatory Int32" { - $CommandUnderTest | Should -HaveParameter ProcessId -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProcessId -Type Int32 -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Stop-DbaService.Tests.ps1 b/tests/Stop-DbaService.Tests.ps1 index 188b71ce9d..a17007aa0d 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have InstanceName as a parameter" { - $CommandUnderTest | Should -HaveParameter InstanceName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InstanceName -Type String[] -Mandatory:$false } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Type as a parameter" { - $CommandUnderTest | Should -HaveParameter Type -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have Timeout as a parameter" { - $CommandUnderTest | Should -HaveParameter Timeout -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Timeout -Type Int32 -Mandatory:$false } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have Force as a parameter" { - $CommandUnderTest | Should -HaveParameter Force -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Force -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Stop-DbaTrace.Tests.ps1 b/tests/Stop-DbaTrace.Tests.ps1 index 10af970a60..d3a1ed501f 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Id as a parameter" { - $CommandUnderTest | Should -HaveParameter Id -Type Int32[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Id -Type Int32[] -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Stop-DbaXESession.Tests.ps1 b/tests/Stop-DbaXESession.Tests.ps1 index 879929a43a..bb2c599fd1 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Session parameter" { - $CommandUnderTest | Should -HaveParameter Session -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Session -Type Object[] -Mandatory:$false } It "Should have AllSessions parameter" { - $CommandUnderTest | Should -HaveParameter AllSessions -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AllSessions -Type Switch -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Session[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Session[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Stop-DbaXESmartTarget.Tests.ps1 b/tests/Stop-DbaXESmartTarget.Tests.ps1 index c2b0495e5d..69d4f89731 100644 --- a/tests/Stop-DbaXESmartTarget.Tests.ps1 +++ b/tests/Stop-DbaXESmartTarget.Tests.ps1 @@ -6,52 +6,52 @@ Describe "Stop-DbaXESmartTarget" { $CommandUnderTest = Get-Command Stop-DbaXESmartTarget } It "Accepts InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Accepts EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Accepts Verbose as a parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Accepts Debug as a parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Accepts ErrorAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Accepts WarningAction as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Accepts InformationAction as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Accepts ProgressAction as a parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Accepts ErrorVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Accepts WarningVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Accepts InformationVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Accepts OutVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Accepts OutBuffer as a parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Accepts PipelineVariable as a parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } It "Accepts WhatIf as a parameter" { - $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WhatIf -Type Switch -Mandatory:$false } It "Accepts Confirm as a parameter" { - $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Confirm -Type Switch -Mandatory:$false } } } diff --git a/tests/Stop-Function.Tests.ps1 b/tests/Stop-Function.Tests.ps1 index e534c612ee..214d3b4cae 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 String parameter" { - $CommandUnderTest | Should -HaveParameter Message -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Message -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory Boolean parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Boolean -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Boolean -Mandatory:$false } It "Should have Category as a non-mandatory ErrorCategory parameter" { - $CommandUnderTest | Should -HaveParameter Category -Type ErrorCategory -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Category -Type ErrorCategory -Mandatory:$false } It "Should have ErrorRecord as a non-mandatory ErrorRecord[] parameter" { - $CommandUnderTest | Should -HaveParameter ErrorRecord -Type ErrorRecord[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorRecord -Type ErrorRecord[] -Mandatory:$false } It "Should have Tag as a non-mandatory String[] parameter" { - $CommandUnderTest | Should -HaveParameter Tag -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Tag -Type String[] -Mandatory:$false } It "Should have FunctionName as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter FunctionName -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FunctionName -Type String -Mandatory:$false } It "Should have File as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter File -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter File -Type String -Mandatory:$false } It "Should have Line as a non-mandatory Int32 parameter" { - $CommandUnderTest | Should -HaveParameter Line -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Line -Type Int32 -Mandatory:$false } It "Should have Target as a non-mandatory Object parameter" { - $CommandUnderTest | Should -HaveParameter Target -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Target -Type Object -Mandatory:$false } It "Should have Exception as a non-mandatory Exception parameter" { - $CommandUnderTest | Should -HaveParameter Exception -Type Exception -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Exception -Type Exception -Mandatory:$false } It "Should have OverrideExceptionMessage as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter OverrideExceptionMessage -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OverrideExceptionMessage -Type Switch -Mandatory:$false } It "Should have Continue as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter Continue -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Continue -Type Switch -Mandatory:$false } It "Should have SilentlyContinue as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter SilentlyContinue -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SilentlyContinue -Type Switch -Mandatory:$false } It "Should have ContinueLabel as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter ContinueLabel -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ContinueLabel -Type String -Mandatory:$false } } diff --git a/tests/Test-DbaAgSpn.Tests.ps1 b/tests/Test-DbaAgSpn.Tests.ps1 index 9238f74518..cf9b9a73f9 100644 --- a/tests/Test-DbaAgSpn.Tests.ps1 +++ b/tests/Test-DbaAgSpn.Tests.ps1 @@ -10,61 +10,61 @@ Describe "Test-DbaAgSpn" { $CommandUnderTest = Get-Command Test-DbaAgSpn } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Credential parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have AvailabilityGroup parameter" { - $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AvailabilityGroup -Type String[] -Mandatory:$false } It "Should have Listener parameter" { - $CommandUnderTest | Should -HaveParameter Listener -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Listener -Type String[] -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type AvailabilityGroup[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type AvailabilityGroup[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } It "Should have Verbose parameter" { - $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Verbose -Type Switch -Mandatory:$false } It "Should have Debug parameter" { - $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Debug -Type Switch -Mandatory:$false } It "Should have ErrorAction parameter" { - $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorAction -Type ActionPreference -Mandatory:$false } It "Should have WarningAction parameter" { - $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningAction -Type ActionPreference -Mandatory:$false } It "Should have InformationAction parameter" { - $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationAction -Type ActionPreference -Mandatory:$false } It "Should have ProgressAction parameter" { - $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ProgressAction -Type ActionPreference -Mandatory:$false } It "Should have ErrorVariable parameter" { - $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ErrorVariable -Type String -Mandatory:$false } It "Should have WarningVariable parameter" { - $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter WarningVariable -Type String -Mandatory:$false } It "Should have InformationVariable parameter" { - $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InformationVariable -Type String -Mandatory:$false } It "Should have OutVariable parameter" { - $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutVariable -Type String -Mandatory:$false } It "Should have OutBuffer parameter" { - $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter OutBuffer -Type Int32 -Mandatory:$false } It "Should have PipelineVariable parameter" { - $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PipelineVariable -Type String -Mandatory:$false } } diff --git a/tests/Test-DbaAgentJobOwner.Tests.ps1 b/tests/Test-DbaAgentJobOwner.Tests.ps1 index bcb5c8afe4..2ce927803f 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Job as a parameter" { - $CommandUnderTest | Should -HaveParameter Job -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Job -Type Object[] -Mandatory:$false } It "Should have ExcludeJob as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeJob -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeJob -Type Object[] -Mandatory:$false } It "Should have Login as a parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Login -Type String -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Test-DbaBuild.Tests.ps1 b/tests/Test-DbaBuild.Tests.ps1 index 656e75785d..e7c7ac45c5 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 Version[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Build -Type Version[] -Mandatory:$false } It "Should have MinimumBuild parameter" { - $CommandUnderTest | Should -HaveParameter MinimumBuild -Type Version -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MinimumBuild -Type Version -Mandatory:$false } It "Should have MaxBehind parameter" { - $CommandUnderTest | Should -HaveParameter MaxBehind -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaxBehind -Type String -Mandatory:$false } It "Should have Latest parameter" { - $CommandUnderTest | Should -HaveParameter Latest -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Latest -Type Switch -Mandatory:$false } It "Should have SqlInstance parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Update parameter" { - $CommandUnderTest | Should -HaveParameter Update -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Update -Type Switch -Mandatory:$false } It "Should have Quiet parameter" { - $CommandUnderTest | Should -HaveParameter Quiet -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Quiet -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Test-DbaComputerCertificateExpiration.Tests.ps1 b/tests/Test-DbaComputerCertificateExpiration.Tests.ps1 index 7960d9faa0..79257edc1b 100644 --- a/tests/Test-DbaComputerCertificateExpiration.Tests.ps1 +++ b/tests/Test-DbaComputerCertificateExpiration.Tests.ps1 @@ -6,31 +6,31 @@ Describe "Test-DbaComputerCertificateExpiration" { $CommandUnderTest = Get-Command Test-DbaComputerCertificateExpiration } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have Store as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Store -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Store -Type String[] -Mandatory:$false } It "Should have Folder as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Folder -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Folder -Type String[] -Mandatory:$false } It "Should have Type as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Type -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Type -Type String -Mandatory:$false } It "Should have Path as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Path -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Path -Type String -Mandatory:$false } It "Should have Thumbprint as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Thumbprint -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Thumbprint -Type String[] -Mandatory:$false } It "Should have Threshold as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter Threshold -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Threshold -Type Int32 -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Test-DbaConnection.Tests.ps1 b/tests/Test-DbaConnection.Tests.ps1 index caefd0a5f2..cb552381c2 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 DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have SkipPSRemoting as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter SkipPSRemoting -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SkipPSRemoting -Type switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Test-DbaDbCompression.Tests.ps1 b/tests/Test-DbaDbCompression.Tests.ps1 index 30c5e81d57..84e2b41878 100644 --- a/tests/Test-DbaDbCompression.Tests.ps1 +++ b/tests/Test-DbaDbCompression.Tests.ps1 @@ -6,34 +6,34 @@ Describe "Test-DbaDbCompression Unit Tests" -Tag 'UnitTests' { $CommandUnderTest = Get-Command Test-DbaDbCompression } It "Should have SqlInstance as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Database -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type String[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type String[] -Mandatory:$false } It "Should have Schema as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Schema -Type String[] -Mandatory:$false } It "Should have Table as a non-mandatory parameter of type String[]" { - $CommandUnderTest | Should -HaveParameter Table -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Table -Type String[] -Mandatory:$false } It "Should have ResultSize as a non-mandatory parameter of type Int32" { - $CommandUnderTest | Should -HaveParameter ResultSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ResultSize -Type Int32 -Mandatory:$false } It "Should have Rank as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter Rank -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Rank -Type String -Mandatory:$false } It "Should have FilterBy as a non-mandatory parameter of type String" { - $CommandUnderTest | Should -HaveParameter FilterBy -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilterBy -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory parameter of type Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Test-DbaDbDataGeneratorConfig.Tests.ps1 b/tests/Test-DbaDbDataGeneratorConfig.Tests.ps1 index 95bc49deb1..44e21a7f32 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 String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilePath -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Test-DbaDbOwner.Tests.ps1 b/tests/Test-DbaDbOwner.Tests.ps1 index dac5cc941f..43f0b2ff4d 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have TargetLogin parameter" { - $CommandUnderTest | Should -HaveParameter TargetLogin -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter TargetLogin -Type String -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Test-DbaDiskAlignment.Tests.ps1 b/tests/Test-DbaDiskAlignment.Tests.ps1 index 8b2ec67c9c..c944dba4ca 100644 --- a/tests/Test-DbaDiskAlignment.Tests.ps1 +++ b/tests/Test-DbaDiskAlignment.Tests.ps1 @@ -12,19 +12,19 @@ Describe "Test-DbaDiskAlignment" { $CommandUnderTest = Get-Command Test-DbaDiskAlignment } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have NoSqlCheck as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter NoSqlCheck -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoSqlCheck -Type switch -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Test-DbaDiskAllocation.Tests.ps1 b/tests/Test-DbaDiskAllocation.Tests.ps1 index 46e78acf66..4bba5717ba 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 Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type Object[] -Mandatory:$false } It "Should have NoSqlCheck as a parameter" { - $CommandUnderTest | Should -HaveParameter NoSqlCheck -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoSqlCheck -Type Switch -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Test-DbaDiskSpeed.Tests.ps1 b/tests/Test-DbaDiskSpeed.Tests.ps1 index c1d6836878..29efcb64cc 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 DbaInstanceParameter[] parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory PSCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a non-mandatory Object[] parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a non-mandatory Object[] parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have AggregateBy as a non-mandatory String parameter" { - $CommandUnderTest | Should -HaveParameter AggregateBy -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AggregateBy -Type String -Mandatory:$false } It "Should have EnableException as a non-mandatory Switch" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Test-DbaIdentityUsage.Tests.ps1 b/tests/Test-DbaIdentityUsage.Tests.ps1 index a077b34018..56a58e41d6 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have Threshold parameter" { - $CommandUnderTest | Should -HaveParameter Threshold -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Threshold -Type Int32 -Mandatory:$false } It "Should have ExcludeSystem parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeSystem -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeSystem -Type Switch -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Test-DbaLastBackup.Tests.ps1 b/tests/Test-DbaLastBackup.Tests.ps1 index 58b2807d2a..bfe2ac6925 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Database as a parameter" { - $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Database -Type Object[] -Mandatory:$false } It "Should have ExcludeDatabase as a parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeDatabase -Type Object[] -Mandatory:$false } It "Should have Destination as a parameter" { - $CommandUnderTest | Should -HaveParameter Destination -Type DbaInstanceParameter -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Destination -Type DbaInstanceParameter -Mandatory:$false } It "Should have DestinationSqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DestinationSqlCredential -Type Object -Mandatory:$false } It "Should have DataDirectory as a parameter" { - $CommandUnderTest | Should -HaveParameter DataDirectory -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DataDirectory -Type String -Mandatory:$false } It "Should have LogDirectory as a parameter" { - $CommandUnderTest | Should -HaveParameter LogDirectory -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter LogDirectory -Type String -Mandatory:$false } It "Should have FileStreamDirectory as a parameter" { - $CommandUnderTest | Should -HaveParameter FileStreamDirectory -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FileStreamDirectory -Type String -Mandatory:$false } It "Should have Prefix as a parameter" { - $CommandUnderTest | Should -HaveParameter Prefix -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Prefix -Type String -Mandatory:$false } It "Should have VerifyOnly as a parameter" { - $CommandUnderTest | Should -HaveParameter VerifyOnly -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter VerifyOnly -Type Switch -Mandatory:$false } It "Should have NoCheck as a parameter" { - $CommandUnderTest | Should -HaveParameter NoCheck -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoCheck -Type Switch -Mandatory:$false } It "Should have NoDrop as a parameter" { - $CommandUnderTest | Should -HaveParameter NoDrop -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoDrop -Type Switch -Mandatory:$false } It "Should have CopyFile as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyFile -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CopyFile -Type Switch -Mandatory:$false } It "Should have CopyPath as a parameter" { - $CommandUnderTest | Should -HaveParameter CopyPath -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter CopyPath -Type String -Mandatory:$false } It "Should have MaxSize as a parameter" { - $CommandUnderTest | Should -HaveParameter MaxSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaxSize -Type Int32 -Mandatory:$false } It "Should have DeviceType as a parameter" { - $CommandUnderTest | Should -HaveParameter DeviceType -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter DeviceType -Type String[] -Mandatory:$false } It "Should have IncludeCopyOnly as a parameter" { - $CommandUnderTest | Should -HaveParameter IncludeCopyOnly -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IncludeCopyOnly -Type Switch -Mandatory:$false } It "Should have IgnoreLogBackup as a parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreLogBackup -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IgnoreLogBackup -Type Switch -Mandatory:$false } It "Should have AzureCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter AzureCredential -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter AzureCredential -Type String -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Database[] -Mandatory:$false } It "Should have MaxTransferSize as a parameter" { - $CommandUnderTest | Should -HaveParameter MaxTransferSize -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaxTransferSize -Type Int32 -Mandatory:$false } It "Should have BufferCount as a parameter" { - $CommandUnderTest | Should -HaveParameter BufferCount -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter BufferCount -Type Int32 -Mandatory:$false } It "Should have IgnoreDiffBackup as a parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreDiffBackup -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IgnoreDiffBackup -Type Switch -Mandatory:$false } It "Should have MaxDop as a parameter" { - $CommandUnderTest | Should -HaveParameter MaxDop -Type Int32 -Not -Mandatory + $CommandUnderTest | Should -HaveParameter MaxDop -Type Int32 -Mandatory:$false } It "Should have ReuseSourceFolderStructure as a parameter" { - $CommandUnderTest | Should -HaveParameter ReuseSourceFolderStructure -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ReuseSourceFolderStructure -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } } diff --git a/tests/Test-DbaLinkedServerConnection.Tests.ps1 b/tests/Test-DbaLinkedServerConnection.Tests.ps1 index 34e35bbb82..e171f1efa4 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Test-DbaLsnChain.Tests.ps1 b/tests/Test-DbaLsnChain.Tests.ps1 index 60fd4a766c..96ea5c5cbf 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 Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilteredRestoreFiles -Type Object[] -Mandatory:$false } It "Should have Continue as a switch parameter" { - $CommandUnderTest | Should -HaveParameter Continue -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Continue -Type switch -Mandatory:$false } It "Should have EnableException as a switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Test-DbaManagementObject.Tests.ps1 b/tests/Test-DbaManagementObject.Tests.ps1 index f4c2bf2158..d13d959db3 100644 --- a/tests/Test-DbaManagementObject.Tests.ps1 +++ b/tests/Test-DbaManagementObject.Tests.ps1 @@ -12,16 +12,16 @@ Describe "Test-DbaManagementObject" { $CommandUnderTest = Get-Command Test-DbaManagementObject } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have VersionNumber as a non-mandatory parameter of type Int32[]" { - $CommandUnderTest | Should -HaveParameter VersionNumber -Type Int32[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter VersionNumber -Type Int32[] -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Test-DbaMaxDop.Tests.ps1 b/tests/Test-DbaMaxDop.Tests.ps1 index 9915eed807..9390a3b0e2 100644 --- a/tests/Test-DbaMaxDop.Tests.ps1 +++ b/tests/Test-DbaMaxDop.Tests.ps1 @@ -11,13 +11,13 @@ Describe "Test-DbaMaxDop" { $CommandUnderTest = Get-Command Test-DbaMaxDop } It "Should have SqlInstance as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Test-DbaSpn.Tests.ps1 b/tests/Test-DbaSpn.Tests.ps1 index af35edaebb..a3745fff6a 100644 --- a/tests/Test-DbaSpn.Tests.ps1 +++ b/tests/Test-DbaSpn.Tests.ps1 @@ -10,13 +10,13 @@ Describe "Test-DbaSpn" { $CommandUnderTest = Get-Command Test-DbaSpn } It "Should have ComputerName as a non-mandatory parameter of type DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Test-DbaTempDbConfig.Tests.ps1 b/tests/Test-DbaTempDbConfig.Tests.ps1 index 18ebb470d3..690402e17b 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 DbaInstanceParameter[]" { - $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential as a non-mandatory parameter of type PSCredential" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type switch -Mandatory:$false } } diff --git a/tests/Test-DbaWindowsLogin.Tests.ps1 b/tests/Test-DbaWindowsLogin.Tests.ps1 index e4911186cc..4a5e6d869f 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[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlInstance -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have SqlCredential parameter" { - $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SqlCredential -Type PSCredential -Mandatory:$false } It "Should have Login parameter" { - $CommandUnderTest | Should -HaveParameter Login -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Login -Type String[] -Mandatory:$false } It "Should have ExcludeLogin parameter" { - $CommandUnderTest | Should -HaveParameter ExcludeLogin -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ExcludeLogin -Type String[] -Mandatory:$false } It "Should have FilterBy parameter" { - $CommandUnderTest | Should -HaveParameter FilterBy -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FilterBy -Type String -Mandatory:$false } It "Should have IgnoreDomains parameter" { - $CommandUnderTest | Should -HaveParameter IgnoreDomains -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter IgnoreDomains -Type String[] -Mandatory:$false } It "Should have InputObject parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Login[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Login[] -Mandatory:$false } It "Should have EnableException parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Test-PSRemoting.Tests.ps1 b/tests/Test-PSRemoting.Tests.ps1 index 7d8f873bee..6baafcc309 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 DbaInstanceParameter" { - $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter -Mandatory:$false } It "Should have Credential as a non-mandatory parameter of type Object" { - $CommandUnderTest | Should -HaveParameter Credential -Type Object -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type Object -Mandatory:$false } It "Should have EnableException as a non-mandatory switch parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } } diff --git a/tests/Unregister-DbatoolsConfig.Tests.ps1 b/tests/Unregister-DbatoolsConfig.Tests.ps1 index 2759a8081a..faf1af0199 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 Config[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ConfigurationItem -Type Config[] -Mandatory:$false } It "Accepts FullName as a parameter" { - $CommandUnderTest | Should -HaveParameter FullName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter FullName -Type String[] -Mandatory:$false } It "Accepts Module as a parameter" { - $CommandUnderTest | Should -HaveParameter Module -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Module -Type String -Mandatory:$false } It "Accepts Name as a parameter" { - $CommandUnderTest | Should -HaveParameter Name -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Name -Type String -Mandatory:$false } It "Accepts Scope as a parameter" { - $CommandUnderTest | Should -HaveParameter Scope -Type ConfigScope -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Scope -Type ConfigScope -Mandatory:$false } } diff --git a/tests/Update-DbaServiceAccount.Tests.ps1 b/tests/Update-DbaServiceAccount.Tests.ps1 index 9926fa2dd7..8006794c5a 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 DbaInstanceParameter[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ComputerName -Type DbaInstanceParameter[] -Mandatory:$false } It "Should have Credential as a parameter" { - $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Credential -Type PSCredential -Mandatory:$false } It "Should have InputObject as a parameter" { - $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter InputObject -Type Object[] -Mandatory:$false } It "Should have ServiceName as a parameter" { - $CommandUnderTest | Should -HaveParameter ServiceName -Type String[] -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ServiceName -Type String[] -Mandatory:$false } It "Should have Username as a parameter" { - $CommandUnderTest | Should -HaveParameter Username -Type String -Not -Mandatory + $CommandUnderTest | Should -HaveParameter Username -Type String -Mandatory:$false } It "Should have ServiceCredential as a parameter" { - $CommandUnderTest | Should -HaveParameter ServiceCredential -Type PSCredential -Not -Mandatory + $CommandUnderTest | Should -HaveParameter ServiceCredential -Type PSCredential -Mandatory:$false } It "Should have PreviousPassword as a parameter" { - $CommandUnderTest | Should -HaveParameter PreviousPassword -Type SecureString -Not -Mandatory + $CommandUnderTest | Should -HaveParameter PreviousPassword -Type SecureString -Mandatory:$false } It "Should have SecurePassword as a parameter" { - $CommandUnderTest | Should -HaveParameter SecurePassword -Type SecureString -Not -Mandatory + $CommandUnderTest | Should -HaveParameter SecurePassword -Type SecureString -Mandatory:$false } It "Should have NoRestart as a parameter" { - $CommandUnderTest | Should -HaveParameter NoRestart -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter NoRestart -Type Switch -Mandatory:$false } It "Should have EnableException as a parameter" { - $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Not -Mandatory + $CommandUnderTest | Should -HaveParameter EnableException -Type Switch -Mandatory:$false } }