Skip to content

Commit ea8a16e

Browse files
committed
Add missing param
1 parent 37dd201 commit ea8a16e

File tree

16 files changed

+24
-24
lines changed

16 files changed

+24
-24
lines changed

SCSM-Get-SCSMWorkItemRequestOffering/Get-SCSMWorkItemRequestOffering.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ function Get-SCSMWorkItemRequestOffering {
3232
BEGIN { Import-Module -Name SMLets -ErrorAction Stop }
3333
PROCESS {
3434
foreach ($Item in $SMObject) {
35-
(Get-SCSMRelationshipObject -BySource $Item | Where-Object { $_.RelationshipID -eq "2730587f-3d88-a4e4-42d8-08cf94535a6e" }).TargetObject |
35+
(Get-SCSMRelationshipObject -BySource $Item | Where-Object -FilterScript { $_.RelationshipID -eq "2730587f-3d88-a4e4-42d8-08cf94535a6e" }).TargetObject |
3636
Select-Object -property @{ Label = "WorkItemName"; Expression = { $Item.Name } }, @{ Label = "WorkItemGUID"; Expression = { $Item.get_id() } }, *
3737

3838
}

TOOL-Expand-ScriptAlias/Expand-ScriptAlias.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function Expand-ScriptAlias {
5959
$Aliases = $AbstractSyntaxTree.FindAll( { $args[0] -is [System.Management.Automation.Language.CommandAst] }, $true) |
6060
ForEach-Object -Process {
6161
$Command = $_.CommandElements[0]
62-
if ($Alias = Get-Alias | Where-Object { $_.Name -eq $Command }) {
62+
if ($Alias = Get-Alias | Where-Object -FilterScript { $_.Name -eq $Command }) {
6363

6464
# Output information
6565
[PSCustomObject]@{

TOOL-Get-ISEShortcut/Get-ISEShortcut.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ function Get-ISEShortCut {
4747
$gps = $psISE.GetType().Assembly
4848
$rm = New-Object -TypeName System.Resources.ResourceManager -ArgumentList GuiStrings, $gps
4949
$rs = $rm.GetResourceSet((Get-Culture), $true, $true)
50-
$rs | Where-Object Name -match 'Shortcut\d?$|^F\d+Keyboard' |
50+
$rs | Where-Object -Property Name -match 'Shortcut\d?$|^F\d+Keyboard' |
5151
Sort-Object -Property Value
5252

5353
}

TOOL-Get-LocalAdministrator/Get-LocalAdministrator.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function Get-LocalAdministratorBuiltin {
3737
$UserPrincipal = New-Object -TypeName System.DirectoryServices.AccountManagement.UserPrincipal($PrincipalContext)
3838
$Searcher = New-Object -TypeName System.DirectoryServices.AccountManagement.PrincipalSearcher
3939
$Searcher.QueryFilter = $UserPrincipal
40-
$Searcher.FindAll() | Where-Object { $_.Sid -Like "*-500" }
40+
$Searcher.FindAll() | Where-Object -FilterScript { $_.Sid -Like "*-500" }
4141
}
4242
Catch {
4343
Write-Warning -Message "$($_.Exception.Message)"

TOOL-Get-NetFramework/Get-NetFramework.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function Get-NetFramework {
4949
# Get the Net Framework Installed
5050
$netFramework = Get-ChildItem -Path 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP' -recurse |
5151
Get-ItemProperty -name Version -EA 0 |
52-
Where-Object { $_.PSChildName -match '^(?!S)\p{L}' } |
52+
Where-Object -FilterScript { $_.PSChildName -match '^(?!S)\p{L}' } |
5353
Select-Object -Property PSChildName, Version
5454

5555
# Prepare output

TOOL-Get-NetworkLevelAuthentication/Get-NetworkLevelAuthentication.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function Get-NetworkLevelAuthentication {
7373
TRY {
7474
IF (-not (Get-Module -Name CimCmdlets)) {
7575
Write-Verbose -Message 'BEGIN - Import Module CimCmdlets'
76-
Import-Module CimCmdlets -ErrorAction 'Stop' -ErrorVariable ErrorBeginCimCmdlets
76+
Import-Module -Name CimCmdlets -ErrorAction 'Stop' -ErrorVariable ErrorBeginCimCmdlets
7777
}
7878
}
7979
CATCH {

TOOL-Get-PSObjectEmptyOrNullProperty/Get-PSObjectEmptyOrNullProperty.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,6 @@ function Get-PSObjectEmptyOrNullProperty {
5050
$PSObject)
5151
PROCESS {
5252
$PsObject.psobject.Properties |
53-
Where-Object { -not $_.value }
53+
Where-Object -FilterScript { -not $_.value }
5454
}
5555
}

TOOL-Get-ProcessForeignAddress/Get-ProcessForeignAddress.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function Get-ProcessForeignAddress {
4646
}
4747

4848
if ($ProcessName) {
49-
$result | Where-Object { $_.processname -like "$processname" }
49+
$result | Where-Object -FilterScript { $_.processname -like "$processname" }
5050
}
5151
else { $Result }
5252
}

TOOL-Get-ScriptAlias/Get-ScriptAlias.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ function Get-ScriptAlias {
4646
$AbstractSyntaxTree.FindAll( { $args[0] -is [System.Management.Automation.Language.CommandAst] }, $true) |
4747
ForEach-Object -Process {
4848
$Command = $_.CommandElements[0]
49-
if ($Alias = Get-Alias | Where-Object { $_.Name -eq $Command }) {
49+
if ($Alias = Get-Alias | Where-Object -FilterScript { $_.Name -eq $Command }) {
5050

5151
# Output information
5252
[PSCustomObject]@{

TOOL-Invoke-Ping/Invoke-Ping.ps1

+4-4
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,13 @@ Function Invoke-Ping {
168168
# One of the veriables that we pass is '$?'.
169169
# There could be other variables with such problems.
170170
# Scope 2 required if we move to a real module
171-
$UserVariables = @(Get-Variable | Where-Object { -not ($VariablesToExclude -contains $_.Name) })
171+
$UserVariables = @(Get-Variable | Where-Object -FilterScript { -not ($VariablesToExclude -contains $_.Name) })
172172
Write-Verbose -Message "Found variables to import: $(($UserVariables | Select-Object -expandproperty Name | Sort-Object) -join ", " | Out-String).`n"
173173

174174
}
175175

176176
if ($ImportModules) {
177-
$UserModules = @(Get-Module | Where-Object { $StandardUserEnv.Modules -notcontains $_.Name -and (Test-Path $_.Path -ErrorAction SilentlyContinue) } | Select-Object -ExpandProperty Path)
177+
$UserModules = @(Get-Module | Where-Object -FilterScript { $StandardUserEnv.Modules -notcontains $_.Name -and (Test-Path $_.Path -ErrorAction SilentlyContinue) } | Select-Object -ExpandProperty Path)
178178
$UserSnapins = @(Get-PSSnapin | Select-Object -ExpandProperty Name | Where-Object { $StandardUserEnv.Snapins -notcontains $_ })
179179
}
180180
}
@@ -278,7 +278,7 @@ Function Invoke-Ping {
278278
#Clean out unused runspace jobs
279279
$temphash = $runspaces.clone()
280280
$temphash |
281-
Where-Object { $null -eq $_.runspace } |
281+
Where-Object -FilterScript { $null -eq $_.runspace } |
282282
ForEach-Object -Process {
283283
$Runspaces.remove($_)
284284
}
@@ -508,7 +508,7 @@ Function Invoke-Ping {
508508
#endregion add scripts to runspace pool
509509
}
510510

511-
Write-Verbose ("Finish processing the remaining runspace jobs: {0}" -f (@($runspaces | Where-Object { $null -ne $_.Runspace }).Count))
511+
Write-Verbose ("Finish processing the remaining runspace jobs: {0}" -f (@($runspaces | Where-Object -FilterScript { $null -ne $_.Runspace }).Count))
512512
Get-RunspaceData -wait
513513

514514
if (-not $quiet) {

TOOL-Remove-PSObjectEmptyOrNullProperty/Remove-PSObjectEmptyOrNullProperty.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Remove-PSObjectEmptyOrNullProperty {
2121
$PSObject)
2222
PROCESS {
2323
$PsObject.psobject.Properties |
24-
Where-Object { -not $_.value } |
24+
Where-Object -FilterScript { -not $_.value } |
2525
ForEach-Object -Process {
2626
$PsObject.psobject.Properties.Remove($_.name)
2727
}

TOOL-Set-NetworkLevelAuthentication/Set-NetworkLevelAuthentication.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function Set-NetworkLevelAuthentication {
5151
TRY {
5252
IF (-not (Get-Module -Name CimCmdlets)) {
5353
Write-Verbose -Message '[BEGIN] Import Module CimCmdlets'
54-
Import-Module CimCmdlets -ErrorAction 'Stop' -ErrorVariable ErrorBeginCimCmdlets
54+
Import-Module -Name CimCmdlets -ErrorAction 'Stop' -ErrorVariable ErrorBeginCimCmdlets
5555
}
5656
}
5757
CATCH {

VMWARE-HOST-List_VIB/VMWARE-HOST-List_VIB.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ BEGIN {
5959
}
6060
PROCESS {
6161
TRY {
62-
$VMHosts = Get-VMHost -ErrorAction Stop -ErrorVariable ErrorGetVMhost | Where-Object { $_.ConnectionState -eq "Connected" }
62+
$VMHosts = Get-VMHost -ErrorAction Stop -ErrorVariable ErrorGetVMhost | Where-Object -FilterScript { $_.ConnectionState -eq "Connected" }
6363

6464
IF ($PSBoundParameters['AllVib']) {
6565
Foreach ($CurrentVMhost in $VMHosts) {
@@ -97,7 +97,7 @@ PROCESS {
9797
# Exposes the ESX CLI functionality of the current host
9898
$ESXCLI = Get-EsxCli -VMHost $CurrentVMhost.name
9999
# Retrieve Vib from vendor $vibvendor
100-
$ESXCLI.software.vib.list() | Where-Object { $_.Vendor -eq $VibVendor } |
100+
$ESXCLI.software.vib.list() | Where-Object -FilterScript { $_.Vendor -eq $VibVendor } |
101101
ForEach-Object
102102
{
103103
$VIB = $_
@@ -128,7 +128,7 @@ PROCESS {
128128
# Exposes the ESX CLI functionality of the current host
129129
$ESXCLI = Get-EsxCli -VMHost $CurrentVMhost.name
130130
# Retrieve Vib with name $vibname
131-
$ESXCLI.software.vib.list() | Where-Object { $_.Name -eq $VibName } |
131+
$ESXCLI.software.vib.list() | Where-Object -FilterScript { $_.Name -eq $VibName } |
132132
ForEach-Object
133133
{
134134
$VIB = $_

VMware-STORAGE-Get-VMhostHbaInfo/Get-VMhostHbaInfo.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ Function Get-VMhostHbaInfo {
173173
IF ($hostsview) {
174174
IF ($hostsview.runtime.PowerState -match "poweredOn") {
175175
Write-Verbose -Message "PROCESS - $($hostview.name) - Status is Powered On"
176-
$esx = $hostsview | Where-Object { $_.runtime.PowerState -match "poweredOn" }
177-
FOREACH ($hba in ($esx.Config.StorageDevice.HostBusAdapter | Where-Object { $_.GetType().Name -eq "HostFibreChannelHba" })) {
176+
$esx = $hostsview | Where-Object -FilterScript { $_.runtime.PowerState -match "poweredOn" }
177+
FOREACH ($hba in ($esx.Config.StorageDevice.HostBusAdapter | Where-Object -FilterScript { $_.GetType().Name -eq "HostFibreChannelHba" })) {
178178
Write-Verbose -Message "PROCESS - $($esx.name) - Retrieving HBA information ..."
179179
$line = "" | Select-Object -Property HostName, HostProduct, HbaDevice, HbaWWN, HbaDriver, HbaModel, HbaFirmwareVersion, HWModel
180180
$line.HostName = $esx.name
@@ -187,7 +187,7 @@ Function Get-VMhostHbaInfo {
187187

188188

189189
Write-Verbose -Message "PROCESS - $($esx.name) - Retrieving HBA Advance information - checking SSH Service..."
190-
IF (((Get-View -ViewType HostSystem -ErrorAction Stop -ErrorVariable ErrorProcessGetViewTypeService -Filter @{ "Name" = $($ESX.name) }).config.service.service | Where-Object { $_.key -eq 'tsm-ssh' }).running) {
190+
IF (((Get-View -ViewType HostSystem -ErrorAction Stop -ErrorVariable ErrorProcessGetViewTypeService -Filter @{ "Name" = $($ESX.name) }).config.service.service | Where-Object -FilterScript { $_.key -eq 'tsm-ssh' }).running) {
191191
if ($hba.driver -match "lpfc") {
192192
$remoteCommand = "head -9 /proc/scsi/lpfc*/* | grep -B1 $($line.HbaWWN) | grep -i 'firmware version' | sed 's/Firmware Version:\{0,1\} \(.*\)/\1/'"
193193
}

_Profiles/functions/Find-Apartment.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Function Find-Apartment {
1515
$AvailableRooms = @()
1616
For ($CurrentPage = 0; $CurrentPage -le $MaxPages; $CurrentPage++) {
1717
$WebPage = Invoke-WebRequest "$URL/search/roo?=roo&s=$Start&query=&zoomToPosting=&minAsk=$MinPrice&maxAsk=$MaxPrice&hasPic=1"
18-
$Results = $WebPage.ParsedHtml.body.innerHTML.Split("`n") | Where-Object { $_ -like "<P class=row*" }
18+
$Results = $WebPage.ParsedHtml.body.innerHTML.Split("`n") | Where-Object -FilterScript { $_ -like "<P class=row*" }
1919
ForEach ($Item in $Results) {
2020
$ItemObject = $ID = $Price = $DatePosted = $Neighborhood = $Link = $Description = $Email = $null
2121
$ID = ($Item -replace ".*pid\=`"", "") -replace "`".*"
@@ -24,7 +24,7 @@ Function Find-Apartment {
2424
$Neighborhood = ($Item -replace ".*\<SMALL\>\(", "") -replace "\)\</SMALL>.*"
2525
If ($Neighborhood -like "<*") { $Neighborhood = "N/A" }
2626
$Link = $URL + ((($Item -replace ".*\<A href\=`"", "") -replace "\<.*") -split ('">'))[0]
27-
$Email = (($(Invoke-WebRequest $Link).ParsedHtml.body.innerHTML.Split("`n") | Where-Object { $_ -like "var displayEmail*" }) -replace "var displayEmail \= `"") -replace "`";"
27+
$Email = (($(Invoke-WebRequest $Link).ParsedHtml.body.innerHTML.Split("`n") | Where-Object -FilterScript { $_ -like "var displayEmail*" }) -replace "var displayEmail \= `"") -replace "`";"
2828
$Description = ((($Item -replace ".*\<A href\=`"", "") -replace "\<.*") -split ('">'))[1]
2929
$ItemObject = New-Object -TypeName PSObject -Property @{
3030
'ID' = $ID

_Profiles/functions/show-object.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ PS > Show-Object $ps
3535
## object navigation syntax. To do this, we look through all
3636
## of the variables for the one with the same object identifier.
3737
$rootVariableName = Get-ChildItem variable:\* -Exclude InputObject, Args |
38-
Where-Object {
38+
Where-Object -FilterScript {
3939
$_.Value -and
4040
($_.Value.GetType() -eq $InputObject.GetType()) -and
4141
($_.Value.GetHashCode() -eq $InputObject.GetHashCode())

0 commit comments

Comments
 (0)