Skip to content

Commit e11c8cb

Browse files
author
Chrissy LeMaire
authored
Merge pull request dataplat#956 from sqlcollaborative/development
small fix for PS v4 and below
2 parents 081f7b8 + f908381 commit e11c8cb

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

dbatools.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
RootModule = 'dbatools.psm1'
1212

1313
# Version number of this module.
14-
ModuleVersion = '0.8.941'
14+
ModuleVersion = '0.8.942'
1515

1616
# ID used to uniquely identify this module
1717
GUID = '9d139310-ce45-41ce-8e8b-d76335aa1789'

functions/Find-DbaCommand.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ Finds all commands searching the entire help for "snapshot", rebuilding the inde
182182
Write-Verbose "Rebuild done in $($swrebuild.Elapsedmilliseconds)ms"
183183

184184
}
185-
$consolidated = Get-Content $idxfile | ConvertFrom-Json
185+
$consolidated = Get-Content -Raw $idxfile | ConvertFrom-Json
186186
$result = $consolidated
187187
if ($Pattern.length -gt 0)
188188
{

functions/Get-DbaSqlBuildReference.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Integrate with other commandlets to have builds checked for all your registered
6868
if(!(Test-Path $writable_idxfile)) {
6969
Copy-Item $orig_idxfile $writable_idxfile
7070
}
71-
return (Get-Content $writable_idxfile)
71+
return (Get-Content -Raw $writable_idxfile)
7272
}
7373
}
7474

internal/Select-DefaultView.ps1

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ Function Select-DefaultView
4646
if ($p -like "* as *")
4747
{
4848
$old, $new = $p -isplit " as "
49-
50-
Add-Member -InputObject $inputobject -MemberType AliasProperty -Name $new -Value $old -Force -ErrorAction SilentlyContinue
49+
# Do not be tempted to not pipe here
50+
$inputobject | Add-Member -MemberType AliasProperty -Name $new -Value $old -Force -ErrorAction SilentlyContinue
5151
$newproperty += $new
5252
}
5353
else
@@ -63,7 +63,8 @@ Function Select-DefaultView
6363

6464
$standardmembers = [System.Management.Automation.PSMemberInfo[]]@($defaultset)
6565

66-
Add-Member -InputObject $inputobject -MemberType MemberSet -Name PSStandardMembers -Value $standardmembers -Force -ErrorAction SilentlyContinue
66+
# Do not be tempted to not pipe here
67+
$inputobject | Add-Member -MemberType MemberSet -Name PSStandardMembers -Value $standardmembers -Force -ErrorAction SilentlyContinue
6768

6869
$inputobject
6970
}

0 commit comments

Comments
 (0)