dbatools icon indicating copy to clipboard operation
dbatools copied to clipboard

Get-DbaDbTable | Export-DbaScript

Open spiralcb opened this issue 2 years ago • 1 comments

Verified issue does not already exist?

Yes

What error did you receive?

WARNING: [16:30:54][Export-DbaScript] InputObject is of type System.Management.Automation.PSObject which is not a SQL Management Object. Only SMO objects are supported

Steps to Reproduce

Get-DbaDbTable -SqlInstance <instance_name> -SqlCredential -Database | Export-DbaScript -FilePath tables.sql

Are you running the latest release?

Yes

Other details or mentions

Get-DbaDbTable -SqlInstance <instance_name> -SqlCredential -Database works fine and list all database tables.

What PowerShell host was used when producing this error

VS Code (terminal)

PowerShell Host Version

[32;1mName Value[0m [32;1m---- -----[0m PSVersion 7.2.1 PSEdition Core GitCommitId 7.2.1 OS Microsoft Windows 10.0.17763 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 Standard (64-bit) 15.0.4073.23

.NET Framework Version

.NET 6.0.0-rtm.21522.10

spiralcb avatar Jan 07 '22 15:01 spiralcb

Sorry, I can not reproduce the issue. @potatoqualitee can you have a look?

andreasjordan avatar Feb 06 '22 16:02 andreasjordan

I am closing this issue now. @spiralcb - please reopen or comment if the problem is still reproducible with the current version of dbatools.

andreasjordan avatar Oct 24 '22 09:10 andreasjordan