dbatools icon indicating copy to clipboard operation
dbatools copied to clipboard

Test-SqlTempDbConfiguration - tempdb on C: validation

Open ClaudioESSilva opened this issue 10 years ago • 3 comments

This is not working as expected. Was running a test on a server with only C drive and the test was false. Should be true. After debug I saw that we are using: ($datafiles.rows | Where-Object { $.FileName -like 'C:*' }).Rows.Count but should be: @($datafiles.rows | Where-Object { $.FileName -like 'C:*' }).Count

@MikeFal want to make the correction? Or can I make it?

test-sqltempdbconfiguration_bug

ClaudioESSilva avatar Aug 01 '16 22:08 ClaudioESSilva

Go ahead and fix it, I'm swamped for doing anything until next week at the earliest.

Plus that makes total sense. :)

MikeFal avatar Aug 02 '16 00:08 MikeFal

@ClaudioESSilva that is a really old version you were looking at. Can you check on the latest, see if there's still an issue?

potatoqualitee avatar Aug 04 '16 12:08 potatoqualitee

After discussion with @dansqldba and reviewing the new code, we identified a bug with the use of SQL queries when they return a single row. If this is the case, they are not in an array and don't have a .Count method. I've taken the newer code and updated with a fix for this. It's in #107 .

MikeFal avatar Aug 08 '16 20:08 MikeFal