Skip to content

Get-DbaInstanceAudit: MaximumFileSizeUnit shows Mb rather than MB #10292

@ReeceGoding

Description

@ReeceGoding

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

No error, just wrong output. It appears that the file size returned by Get-DbaInstanceAudit reports Mb rather than MB.

Image

Steps to Reproduce

$primary = Connect-DbaInstance -SqlInstance Whatever
$StupidPath = (Get-DbaDefaultPath -SqlInstance $primary).Log                                                                    
Invoke-DbaQuery -SqlInstance $primary -Query "CREATE SERVER AUDIT NewAudit TO FILE (FILEPATH = '$StupidPath', MAXSIZE = 100 MB)"
Get-DbaInstanceAudit -SqlInstance $primary -Audit NewAudit   

Incidentally, I would like to know if there is a better way to write this. I'm not aware of a dbatools wrapper for CREATE SERVER AUDIT.

Please confirm that you are running the most recent version of dbatools

2.7.27

Other details or mentions

No response

What PowerShell host was used when producing this error

PowerShell Core (pwsh.exe)

PowerShell Host Version

Name Value


PSVersion 7.6.0-preview.6
PSEdition Core
GitCommitId 7.6.0-preview.6
OS Debian GNU/Linux forky/sid
Platform Unix
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.4
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

SQL Server Edition and Build number

Microsoft SQL Server 2025 (RTM-CU3) (KB5077896) - 17.0.4025.3 (X64) …

.NET Framework Version

.NET 10.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions