dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.39k stars 787 forks source link

Get-DbaBackupInformation is not reading values for "IsCopyOnly" attribute #9295

Closed david-garcia-garcia closed 3 months ago

david-garcia-garcia commented 3 months ago

Verified issue does not already exist?

I have searched and found no existing issue

What error did you receive?

Get-DbaBackupInformation is not reading values for "IsCopyOnly" attribute. There are differences in results between calling Get-DbaBackupInformation and Read-DbaBackupHeader on a COPY ONLY backup.

image

Steps to Reproduce

$path = "c:\mycopyonly.bak"
$a = Get-DbaBackupInformation "localhost" -Path $path
$b = Get-ReadDbaBackupHeader "localhost" -Path $path

# Note that $a.IsCopyOnly != $b.IsCopyOnly

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

2.1.7

Other details or mentions

No response

What PowerShell host was used when producing this error

PowerShell Core (pwsh.exe), Windows PowerShell (powershell.exe)

PowerShell Host Version

Name Value


PSVersion 7.4.1 PSEdition Core GitCommitId 7.4.1 OS Microsoft Windows 10.0.22631 Platform Win32NT PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 WSManStackVersion 3.0

SQL Server Edition and Build number

Microsoft SQL Server 2022 (RTM) - 16.0.1000.6 (X64) Oct 8 2022 05:58:25 Copyright (C) 2022 Microsoft Corporation Developer Edition (64-bit) on Windows Server 2022 Datacenter 10.0 (Build 20348: ) (Hypervisor)

.NET Framework Version

4.7.2