Permalink
Browse files

Remove mandatory = $false (#4691)

  • Loading branch information...
ijeb authored and potatoqualitee committed Nov 27, 2018
1 parent 41f3c9f commit 2ad09baadc6c3a687aeff89caf50bb5e16d42ca1
Showing with 36 additions and 200 deletions.
  1. +0 −2 functions/Backup-DbaDbCertificate.ps1
  2. +0 −1 functions/Copy-DbaDatabase.ps1
  3. +1 −2 functions/Find-DbaBackup.ps1
  4. +0 −2 functions/Find-DbaOrphanedFile.ps1
  5. +1 −1 functions/Get-DbaAgentJobOutputFile.ps1
  6. +1 −1 functions/Get-DbaBuildReference.ps1
  7. +4 −4 functions/Get-DbaQueryExecutionTime.ps1
  8. +1 −3 functions/Get-DbaSpn.ps1
  9. +0 −5 functions/Get-DbaSsisEnvironmentVariable.ps1
  10. +2 −2 functions/Get-DbaUserPermission.ps1
  11. +0 −1 functions/Install-DbaWhoIsActive.ps1
  12. +0 −75 functions/Invoke-DbaDbLogShipping.ps1
  13. +2 −16 functions/Invoke-SqlCmd2.ps1
  14. +4 −4 functions/Measure-DbaDiskSpaceRequirement.ps1
  15. +1 −10 functions/New-DbaConnectionStringBuilder.ps1
  16. +0 −1 functions/Remove-DbaAgentJobCategory.ps1
  17. +0 −1 functions/Remove-DbaAgentJobStep.ps1
  18. +0 −2 functions/Remove-DbaBackup.ps1
  19. +0 −1 functions/Remove-DbaDatabase.ps1
  20. +0 −5 functions/Remove-DbaDatabaseSafely.ps1
  21. +1 −2 functions/Remove-DbaDbBackupRestoreHistory.ps1
  22. +0 −1 functions/Remove-DbaLogin.ps1
  23. +1 −1 functions/Remove-DbaOrphanUser.ps1
  24. +1 −1 functions/Remove-DbaSpn.ps1
  25. +1 −1 functions/Repair-DbaOrphanUser.ps1
  26. +0 −1 functions/Set-DbaAgentJobCategory.ps1
  27. +2 −2 functions/Set-DbaAgentJobOutputFile.ps1
  28. +0 −18 functions/Set-DbaAgentJobStep.ps1
  29. +0 −15 functions/Set-DbaAgentSchedule.ps1
  30. +1 −1 functions/Set-DbaSpn.ps1
  31. +1 −1 functions/Test-DbaBuild.ps1
  32. +2 −2 functions/Test-DbaIdentityUsage.ps1
  33. +0 −1 functions/Update-dbatools.ps1
  34. +0 −1 internal/dynamicparams/tag.ps1
  35. +1 −1 internal/functions/Get-OfflineSqlFileStructure.ps1
  36. +1 −1 internal/functions/Get-SqlFileStructure.ps1
  37. +1 −2 internal/functions/Invoke-DbaDatabaseCorruption.ps1
  38. +2 −2 internal/functions/Invoke-Parallel.ps1
  39. +1 −2 internal/functions/New-DbaLogShippingSecondaryPrimary.ps1
  40. +1 −2 internal/functions/New-DbaTeppCompletionResult.ps1
  41. +2 −2 optional/Expand-Archive.ps1
  42. +0 −1 optional/TabExpansionPlusPlus.ps1
@@ -122,9 +122,7 @@ function Backup-DbaDbCertificate {
[object[]]$Database,
[parameter(ParameterSetName = "instance")]
[object[]]$ExcludeDatabase,
[parameter(Mandatory = $false)]
[Security.SecureString]$EncryptionPassword,
[parameter(Mandatory = $false)]
[Security.SecureString]$DecryptionPassword,
[System.IO.FileInfo]$Path,
[string]$Suffix = "$(Get-Date -format 'yyyyMMddHHmmssms')",
@@ -166,7 +166,6 @@ function Copy-DbaDatabase {
[CmdletBinding(DefaultParameterSetName = "DbBackup", SupportsShouldProcess)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseOutputTypeCorrectly", "", Justification = "PSSA Rule Ignored by BOH")]
param (
[parameter(Mandatory = $false)]
[DbaInstanceParameter]$Source,
[PSCredential]$SourceSqlCredential,
[parameter(Mandatory)]
@@ -71,7 +71,6 @@ function Find-DbaBackup {
[string]$BackupFileExtension ,
[parameter(Mandatory, HelpMessage = "Backup retention period. (ex. 24h, 7d, 4w, 6m)")]
[string]$RetentionPeriod ,
[parameter(Mandatory = $false)]
[switch]$CheckArchiveBit = $false ,
[Alias('Silent')]
[switch]$EnableException
@@ -97,7 +96,7 @@ function Find-DbaBackup {
'7d' = 7 days
'4w' = 4 weeks
'1m' = 1 month
#>
#>
[int]$Length = ($UserFriendlyRetention).Length
$Value = ($UserFriendlyRetention).Substring(0, $Length - 1)
@@ -85,9 +85,7 @@ function Find-DbaOrphanedFile {
[parameter(Mandatory, ValueFromPipeline)]
[Alias("ServerInstance", "SqlServer")]
[DbaInstanceParameter[]]$SqlInstance,
[parameter(Mandatory = $false)]
[pscredential]$SqlCredential,
[parameter(Mandatory = $false)]
[string[]]$Path,
[string[]]$FileType,
[switch]$LocalOnly,
@@ -90,7 +90,7 @@ function Get-DbaAgentJobOutputFile {
[ValidateNotNullOrEmpty()]
[Alias("ServerInstance", "SqlServer")]
[DbaInstanceParameter[]]$SqlInstance,
[Parameter(Mandatory = $false, HelpMessage = 'SQL Credential',
[Parameter(HelpMessage = 'SQL Credential',
ValueFromPipelineByPropertyName = $true,
ValueFromRemainingArguments = $false,
Position = 1)]
@@ -63,7 +63,7 @@ function Get-DbaBuildReference {
[version[]]
$Build,
[parameter(Mandatory = $false, ValueFromPipeline)]
[parameter(ValueFromPipeline)]
[Alias("ServerInstance", "SqlServer")]
[DbaInstanceParameter[]]
$SqlInstance,
@@ -74,13 +74,13 @@ function Get-DbaQueryExecutionTime {
[Alias("Databases")]
[object[]]$Database,
[object[]]$ExcludeDatabase,
[parameter(Position = 1, Mandatory = $false)]
[parameter(Position = 1)]
[int]$MaxResultsPerDb = 100,
[parameter(Position = 2, Mandatory = $false)]
[parameter(Position = 2)]
[int]$MinExecs = 100,
[parameter(Position = 3, Mandatory = $false)]
[parameter(Position = 3)]
[int]$MinExecMs = 500,
[parameter(Position = 4, Mandatory = $false)]
[parameter(Position = 4)]
[Alias("ExcludeSystemDatabases")]
[switch]$ExcludeSystem,
[Alias('Silent')]
@@ -52,11 +52,9 @@ function Get-DbaSpn {
[cmdletbinding()]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseApprovedVerbs", "", Justification = "Internal functions are ignored")]
param (
[Parameter(Mandatory = $false, ValueFromPipeline)]
[Parameter(ValueFromPipeline)]
[string[]]$ComputerName,
[Parameter(Mandatory = $false)]
[string[]]$AccountName,
[Parameter(Mandatory = $false)]
[PSCredential]$Credential,
[Alias('Silent')]
[switch]$EnableException
@@ -110,15 +110,10 @@ function Get-DbaSsisEnvironmentVariable {
[parameter(Mandatory, ValueFromPipeline)]
[Alias('SqlServer', 'ServerInstance')]
[DbaInstanceParameter[]]$SqlInstance,
[Parameter(Mandatory = $false)]
[PSCredential]$SqlCredential,
[parameter(Mandatory = $false)]
[object[]]$Environment,
[parameter(Mandatory = $false)]
[object[]]$EnvironmentExclude,
[parameter(Mandatory = $false)]
[object[]]$Folder,
[parameter(Mandatory = $false)]
[object[]]$FolderExclude,
[Alias('Silent')]
[switch]$EnableException
@@ -63,7 +63,7 @@ function Get-DbaUserPermission {
Check server and database permissions on server sql2008 for only the TestDB database,
including public and guest grants, and sys schema objects.
#>
#>
[CmdletBinding()]
param (
[parameter(Position = 0, Mandatory, ValueFromPipeline)]
@@ -73,7 +73,7 @@ function Get-DbaUserPermission {
[Alias("Databases")]
[object[]]$Database,
[object[]]$ExcludeDatabase,
[parameter(Position = 1, Mandatory = $false)]
[parameter(Position = 1)]
[switch]$ExcludeSystemDatabase,
[switch]$IncludePublicGuest,
[switch]$IncludeSystemObjects,
@@ -75,7 +75,6 @@ function Install-DbaWhoIsActive {
[Alias("ServerInstance", "SqlServer")]
[DbaInstanceParameter[]]$SqlInstance,
[PsCredential]$SqlCredential,
[parameter(Mandatory = $false)]
[ValidateScript( { Test-Path -Path $_ -PathType Leaf })]
[string]$LocalFile,
[object]$Database,
@@ -398,19 +398,15 @@ function Invoke-DbaDbLogShipping {
[Alias("DestinationServerInstance", "DestinationSqlServer", "Destination")]
[object[]]$DestinationSqlInstance,
[Parameter(Mandatory = $false)]
[System.Management.Automation.PSCredential]
$SourceSqlCredential,
[Parameter(Mandatory = $false)]
[System.Management.Automation.PSCredential]
$SourceCredential,
[Parameter(Mandatory = $false)]
[System.Management.Automation.PSCredential]
$DestinationSqlCredential,
[Parameter(Mandatory = $false)]
[System.Management.Automation.PSCredential]
$DestinationCredential,
@@ -420,230 +416,159 @@ function Invoke-DbaDbLogShipping {
[parameter(Mandatory)]
[string]$BackupNetworkPath,
[parameter(Mandatory = $false)]
[string]$BackupLocalPath,
[parameter(Mandatory = $false)]
[string]$BackupJob,
[parameter(Mandatory = $false)]
[int]$BackupRetention,
[parameter(Mandatory = $false)]
[string]$BackupSchedule,
[parameter(Mandatory = $false)]
[switch]$BackupScheduleDisabled,
[parameter(Mandatory = $false)]
[ValidateSet("Daily", "Weekly", "AgentStart", "IdleComputer")]
[object]$BackupScheduleFrequencyType,
[parameter(Mandatory = $false)]
[object[]]$BackupScheduleFrequencyInterval,
[parameter(Mandatory = $false)]
[ValidateSet('Time', 'Seconds', 'Minutes', 'Hours')]
[object]$BackupScheduleFrequencySubdayType,
[parameter(Mandatory = $false)]
[int]$BackupScheduleFrequencySubdayInterval,
[Parameter(Mandatory = $false)]
[ValidateSet('Unused', 'First', 'Second', 'Third', 'Fourth', 'Last')]
[object]$BackupScheduleFrequencyRelativeInterval,
[Parameter(Mandatory = $false)]
[int]$BackupScheduleFrequencyRecurrenceFactor,
[parameter(Mandatory = $false)]
[string]$BackupScheduleStartDate,
[parameter(Mandatory = $false)]
[string]$BackupScheduleEndDate,
[parameter(Mandatory = $false)]
[string]$BackupScheduleStartTime,
[parameter(Mandatory = $false)]
[string]$BackupScheduleEndTime,
[parameter(Mandatory = $false)]
[int]$BackupThreshold,
[parameter(Mandatory = $false)]
[switch]$CompressBackup,
[parameter(Mandatory = $false)]
[string]$CopyDestinationFolder,
[parameter(Mandatory = $false)]
[string]$CopyJob,
[parameter(Mandatory = $false)]
[int]$CopyRetention,
[parameter(Mandatory = $false)]
[string]$CopySchedule,
[parameter(Mandatory = $false)]
[switch]$CopyScheduleDisabled,
[parameter(Mandatory = $false)]
[ValidateSet("Daily", "Weekly", "AgentStart", "IdleComputer")]
[object]$CopyScheduleFrequencyType,
[parameter(Mandatory = $false)]
[object[]]$CopyScheduleFrequencyInterval,
[parameter(Mandatory = $false)]
[ValidateSet('Time', 'Seconds', 'Minutes', 'Hours')]
[object]$CopyScheduleFrequencySubdayType,
[parameter(Mandatory = $false)]
[int]$CopyScheduleFrequencySubdayInterval,
[Parameter(Mandatory = $false)]
[ValidateSet('Unused', 'First', 'Second', 'Third', 'Fourth', 'Last')]
[object]$CopyScheduleFrequencyRelativeInterval,
[Parameter(Mandatory = $false)]
[int]$CopyScheduleFrequencyRecurrenceFactor,
[parameter(Mandatory = $false)]
[string]$CopyScheduleStartDate,
[parameter(Mandatory = $false)]
[string]$CopyScheduleEndDate,
[parameter(Mandatory = $false)]
[string]$CopyScheduleStartTime,
[parameter(Mandatory = $false)]
[string]$CopyScheduleEndTime,
[parameter(Mandatory = $false)]
[switch]$DisconnectUsers,
[parameter(Mandatory = $false)]
[string]$FullBackupPath,
[parameter(Mandatory = $false)]
[switch]$GenerateFullBackup,
[parameter(Mandatory = $false)]
[int]$HistoryRetention,
[parameter(Mandatory = $false)]
[switch]$NoRecovery,
[parameter(Mandatory = $false)]
[switch]$NoInitialization,
[Parameter(Mandatory = $false)]
[string]$PrimaryMonitorServer,
[Parameter(Mandatory = $false)]
[System.Management.Automation.PSCredential]
$PrimaryMonitorCredential,
[Parameter(Mandatory = $false)]
[ValidateSet(0, "sqlserver", 1, "windows")]
[object]$PrimaryMonitorServerSecurityMode,
[Parameter(Mandatory = $false)]
[switch]$PrimaryThresholdAlertEnabled,
[parameter(Mandatory = $false)]
[string]$RestoreDataFolder,
[parameter(Mandatory = $false)]
[string]$RestoreLogFolder,
[parameter(Mandatory = $false)]
[int]$RestoreDelay,
[parameter(Mandatory = $false)]
[int]$RestoreAlertThreshold,
[parameter(Mandatory = $false)]
[string]$RestoreJob,
[parameter(Mandatory = $false)]
[int]$RestoreRetention,
[parameter(Mandatory = $false)]
[string]$RestoreSchedule,
[parameter(Mandatory = $false)]
[switch]$RestoreScheduleDisabled,
[parameter(Mandatory = $false)]
[ValidateSet("Daily", "Weekly", "AgentStart", "IdleComputer")]
[object]$RestoreScheduleFrequencyType,
[parameter(Mandatory = $false)]
[object[]]$RestoreScheduleFrequencyInterval,
[parameter(Mandatory = $false)]
[ValidateSet('Time', 'Seconds', 'Minutes', 'Hours')]
[object]$RestoreScheduleFrequencySubdayType,
[parameter(Mandatory = $false)]
[int]$RestoreScheduleFrequencySubdayInterval,
[Parameter(Mandatory = $false)]
[ValidateSet('Unused', 'First', 'Second', 'Third', 'Fourth', 'Last')]
[object]$RestoreScheduleFrequencyRelativeInterval,
[Parameter(Mandatory = $false)]
[int]$RestoreScheduleFrequencyRecurrenceFactor,
[parameter(Mandatory = $false)]
[string]$RestoreScheduleStartDate,
[parameter(Mandatory = $false)]
[string]$RestoreScheduleEndDate,
[parameter(Mandatory = $false)]
[string]$RestoreScheduleStartTime,
[parameter(Mandatory = $false)]
[string]$RestoreScheduleEndTime,
[parameter(Mandatory = $false)]
[int]$RestoreThreshold,
[parameter(Mandatory = $false)]
[string]$SecondaryDatabasePrefix,
[parameter(Mandatory = $false)]
[string]$SecondaryDatabaseSuffix,
[Parameter(Mandatory = $false)]
[string]$SecondaryMonitorServer,
[Parameter(Mandatory = $false)]
[System.Management.Automation.PSCredential]
$SecondaryMonitorCredential,
[Parameter(Mandatory = $false)]
[ValidateSet(0, "sqlserver", 1, "windows")]
[object]$SecondaryMonitorServerSecurityMode,
[Parameter(Mandatory = $false)]
[switch]$SecondaryThresholdAlertEnabled,
[parameter(Mandatory = $false)]
[switch]$Standby,
[parameter(Mandatory = $false)]
[string]$StandbyDirectory,
[parameter(Mandatory = $false)]
[switch]$UseExistingFullBackup,
[parameter(Mandatory = $false)]
[string]$UseBackupFolder,
[switch]$Force,
Oops, something went wrong.

0 comments on commit 2ad09ba

Please sign in to comment.