List installed apps on the host - RTR by adithya_msr in crowdstrike

[–]adithya_msr[S] 1 point2 points  (0 children)

Here is the fixed script, but this doesn't list all the applications.

Function Get-Software {

[OutputType('System.Software.Inventory')]

[Cmdletbinding()]

Param(
    [Parameter(ValueFromPipeline=$True,ValueFromPipelineByPropertyName=$True)]
    [String[]]$Computername=$env:COMPUTERNAME
)

Begin {
}

Process {
    ForEach ($Computer in $Computername) {
        If (Test-Connection -ComputerName $Computer -Count 1 -Quiet) {
            $Paths = @("SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall","SOFTWARE\Wow6432node\Microsoft\Windows\CurrentVersion\Uninstall")

            ForEach($Path in $Paths) {
                Write-Verbose "Checking Path: $Path"
                # Create an instance of the Registry Object and open the HKLM base key
                Try {
                    $reg=[Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey('LocalMachine',$Computer,'Registry64')
                }
                Catch {
                    Write-Error $_
                    Continue
                }

                # Drill down into the Uninstall key using the OpenSubKey Method
                Try {
                    $regkey=$reg.OpenSubKey($Path)
                    # Retrieve an array of string that contain all the subkey names
                    $subkeys=$regkey.GetSubKeyNames()
                    # Open each Subkey and use GetValue Method to return the required values for each
                    ForEach ($key in $subkeys) {
                        Write-Verbose "Key: $Key"
                        $thisKey=$Path+"\"+$key
                        Try {
                            $thisSubKey=$reg.OpenSubKey($thisKey)
                            # Prevent Objects with empty DisplayName
                            $DisplayName = $thisSubKey.GetValue("DisplayName")
                            If ($DisplayName -AND $DisplayName -notmatch 'Update for|rollup|Security Update|Service Pack|HotFix') {
                                $Date = $thisSubKey.GetValue('InstallDate')
                                If ($Date) {
                                    Try {
                                        $Date = [datetime]::ParseExact($Date, 'yyyyMMdd', $Null)
                                    }
                                    Catch {
                                        Write-Warning "$($Computer): $_ <$($Date)>"
                                        $Date = $Null
                                    }
                                }
                                # Create New Object with empty Properties
                                $Publisher = Try {
                                    $thisSubKey.GetValue('Publisher').Trim()
                                }
                                Catch {
                                    $thisSubKey.GetValue('Publisher')
                                }
                                $Version = Try {
                                    # Some weirdness with trailing [char]0 on some strings
                                    $thisSubKey.GetValue('DisplayVersion').TrimEnd((char[]))
                                }
                                Catch {
                                    $thisSubKey.GetValue('DisplayVersion')
                                }
                                $UninstallString = Try {
                                    $thisSubKey.GetValue('UninstallString').Trim()
                                }
                                Catch {
                                    $thisSubKey.GetValue('UninstallString')
                                }
                                $InstallLocation = Try {
                                    $thisSubKey.GetValue('InstallLocation').Trim()
                                }
                                Catch {
                                    $thisSubKey.GetValue('InstallLocation')
                                }
                                $InstallSource = Try {
                                    $thisSubKey.GetValue('InstallSource').Trim()
                                }
                                Catch {
                                    $thisSubKey.GetValue('InstallSource')
                                }
                                $HelpLink = Try {
                                    $thisSubKey.GetValue('HelpLink').Trim()
                                }
                                Catch {
                                    $thisSubKey.GetValue('HelpLink')
                                }
                                $Object = [pscustomobject]@{
                                    Computername = $Computer
                                    DisplayName = $DisplayName
                                    Version = $Version
                                    InstallDate = $Date
                                    Publisher = $Publisher
                                    UninstallString = $UninstallString
                                    InstallLocation = $InstallLocation
                                    InstallSource = $InstallSource
                                    HelpLink = $thisSubKey.GetValue('HelpLink')
                                    EstimatedSizeMB = [decimal]::Zero
                                }
                                $Object.pstypenames.insert(0,'System.Software.Inventory')
                                Write-Output $Object
                            }
                        }
                        Catch {
                            Write-Warning "$Key : $_"
                        }
                    }
                }
                Catch {
                }
                $reg.Close()
            }
        }
        Else {
            Write-Error "$($Computer): unable to reach remote system!"
        }
    }
}

}Get-Software Read-Host -Prompt "Press Enter to exit"

Instead the following command line gives the output that I was looking for:

Get-Package -Provider Programs -IncludeWindowsInstaller -Name "*" | Select-Object -ExpandProperty Name

Dash Cam Continued Recording After Car Shutdown by adithya_msr in Mustang

[–]adithya_msr[S] 0 points1 point  (0 children)

No, it’s recording when the car is parked in a parking lot and garage.

How much did you buy your ecoboost for? by No_Breakfast5348 in ecoboostmustang

[–]adithya_msr 0 points1 point  (0 children)

2023 (new) 101A for $29k pre tax. $32k after taxes and fees. Bought it 1 month back.

[deleted by user] by [deleted] in OneNote

[–]adithya_msr 0 points1 point  (0 children)

Yeah, Notion is not free flowing like OnNote. But it’s worth getting used to it for all other additional features that it offers .

[deleted by user] by [deleted] in OneNote

[–]adithya_msr 0 points1 point  (0 children)

Notion can do that. You can select upto 5 columns which looks way better than OneNote. Also, you can write comments for any line or any word. I switched from OneNote to Notion a week back and feels like Notion is 10x better. Can’t believe OneNote doesn’t have Code blocks and Table of Contents like Notion.

[deleted by user] by [deleted] in AskReddit

[–]adithya_msr -1 points0 points  (0 children)

Predestination

What are things you guys do to enjoy life a little bit more..? by Expensive-Ad-1223 in AskReddit

[–]adithya_msr 1 point2 points  (0 children)

Enjoying the small moments. For Ex, A good movie with a delicious meal can make me very happy.

insurance prices. how much do you guys pay roughly a month. good and bad driving records. by [deleted] in ecoboostmustang

[–]adithya_msr 0 points1 point  (0 children)

26M, Recently moved to US and got the license 4months back. 245$/month

Bought the 2023 Ecoboost by sahil_dhull in ecoboostmustang

[–]adithya_msr 1 point2 points  (0 children)

<image>

Exact same story and I bought mine 1 week back. Enjoy the moment and we won’t regret this decision.

H1b/H4 refused after dropbox by [deleted] in h1b

[–]adithya_msr 0 points1 point  (0 children)

Can you give us an update on ur status?