. is a dot sourcing statement that runs a script in the current scope, and not in a new scope, such as a call statement (i.e. & ).
This second segment calls the script block, and an extended function is defined in this script block. An extended function iterates through each element in the pipeline and selectively passes it.
This is not an idiomatic use. What this script is trying to achieve can be done in a simpler and more understandable way using Where-Object (often shortened to where or ? ):
Get-ItemProperty $path | where { $_.DisplayName -and $_.UninstallString }
source share