If(($InstalledProgram.DisplayName -ne $Null) -and ($("System Analyzer"))) If(($InstalledProgram.DisplayName -ne $Null) -and ($("Management Studio"))) Log-InstalledProgram $InstalledProgram $logFilePath If(($InstalledProgram.DisplayName -ne $Null) -and ($("Operational Control"))) $InstalledPrograms = Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*įoreach ($InstalledProgram in $InstalledPrograms ) $log = "Date Of Testing: " -f (Get-Date)Īdd-content -Path $logFilePath -Value $log -ForceĪdd-content -Path $logFilePath -Value $logString -ForceĪdd-content -Path $logFilePath -Value "`n" -ForceĪdd-content -Path $logFilePath -Value "Add/Remove Programs :" -Force #If log file exists, then clear its contents $logFilePath= Join-path $scriptPath "TestResults.log" #$scriptPath = split-path -parent $MyInvocation.M圜ommand.Definition How to write a function to avoid Repeated code for my powershell script, which basically display list of application installed on my machine from Add and Remove window present in control panel.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |