Skip to content

Commit 6f1c308

Browse files
committed
Commit
1 parent f64051c commit 6f1c308

File tree

3 files changed

+225
-1
lines changed

3 files changed

+225
-1
lines changed

Get-OnlineVerKeePass.ps1

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
<#
2+
===========================================================================
3+
Created with: PowerShell ISE - Win10 21H1/19043
4+
Revision: v1
5+
Last Modified: 31 Mar 2022
6+
Created by: Jay Harper (github.com/thecatdidit/powershellusefulscripts)
7+
Organizaiton: Happy Days Are Here Again
8+
Filename: Get-OnlineVerKeePass.ps1
9+
===========================================================================
10+
.CHANGELOG
11+
[03.31.22] Initial script creation
12+
13+
.SYNOPSIS
14+
Queries for the current version of KeePass and returns the version, date updated, and
15+
download URLs if available.
16+
17+
.DESCRIPTION
18+
This function retrieves the latest data associated with KeePass
19+
Invoke-WebRequest queries the site to obtain app release date, version and
20+
download URLs. This includes both the standard EXE installer and the MSI
21+
instance
22+
23+
It then outputs the information as a
24+
PSObject to the Host
25+
26+
App Release Feed (JSON): https://sourceforge.net/projects/keepass/best_release.json
27+
28+
.EXAMPLE
29+
PS C:\> Get-OnlineVerKeePass.ps1
30+
31+
Software_Name : Atlassian Companion
32+
Software_URL : https://confluence.atlassian.com
33+
Online_Version : 1.3.1
34+
Online_Date : 12 November 2021
35+
EXE_Installer : https://update-nucleus.atlassian.com/Atlassian-Companion/291cb34fe2296e5fb82b83a04704c9b4/latest/win32/ia32/Atlassian%20Companion.exe
36+
MSI_Installer : https://update-nucleus.atlassian.com/Atlassian-Companion/291cb34fe2296e5fb82b83a04704c9b4/latest/win32/ia32/Atlassian%20Companion.msi
37+
38+
PS C:\> Get-OnlineVerAtlassianCompanion -Quiet
39+
1.3.1
40+
41+
.INPUTS
42+
-Quiet
43+
Use of this parameter will output just the current version of
44+
Atlassian Companion instead of the entire object. It will always be the
45+
last parameter
46+
47+
.OUTPUTS
48+
An object containing the following:
49+
Software Name: Name of the software
50+
Software URL: The URL info was sourced from
51+
Online Version: The current version found
52+
Online Date: The date the version was updated
53+
EXE Installer: Direct download link for the EXE-based installer
54+
MSI Installer: Direct download link for the MSI-based installed
55+
56+
If -Quiet is specified then just the value of 'Online Version'
57+
will be displayed.
58+
.NOTES
59+
Resources/Credits:
60+
https://github.com/itsontheb
61+
#>
62+
63+
function Get-OnlineVerAtlassianCompanion {
64+
[cmdletbinding()]
65+
param (
66+
[Parameter(Mandatory = $false,
67+
Position = 0)]
68+
[switch]
69+
$Quiet
70+
)
71+
72+
begin {
73+
# Initial Variables
74+
$SoftwareName = 'Atlassian Companion'
75+
$URI = 'https://confluence.atlassian.com'
76+
77+
$hashtable = [ordered]@{
78+
'Software_Name' = $softwareName
79+
'Software_URL' = $uri
80+
'Online_Version' = 'UNKNOWN'
81+
'Online_Date' = 'UNKNOWN'
82+
'EXE_Installer' = 'https://update-nucleus.atlassian.com/Atlassian-Companion/291cb34fe2296e5fb82b83a04704c9b4/latest/win32/ia32/Atlassian%20Companion.exe'
83+
'MSI_Installer' = 'https://update-nucleus.atlassian.com/Atlassian-Companion/291cb34fe2296e5fb82b83a04704c9b4/latest/win32/ia32/Atlassian%20Companion.msi'
84+
}
85+
86+
$swObject = New-Object -TypeName PSObject -Property $hashtable
87+
}
88+
89+
90+
Process {
91+
# Get the Version & Release Date
92+
try {
93+
Write-Verbose -Message "Attempting to pull info from the below URL: `n $URI"
94+
$URI = 'https://confluence.atlassian.com/doc/atlassian-companion-app-release-notes-958455712.html'
95+
$ACURL = (Invoke-WebRequest -Uri $URI -UseBasicParsing | Select-Object -ExpandProperty Content)
96+
$query = "Latest versions</h2><h3 id=""AtlassianCompanionappreleasenotes-AtlassianCompanion"">Atlassian Companion (?<version>.*)</h3><p>Released (?<date>.*)</p><p>"
97+
$ACURL -match $query
98+
99+
$ACVersion = ($matches['version'])
100+
$ACDate = ($matches['date'])
101+
102+
$swObject.Online_Version = $ACVersion
103+
$swObject.Online_Date = $ACDate
104+
105+
}
106+
catch {
107+
Write-Verbose -Message "Error accessing the below URL: `n $URI"
108+
$message = $("Line {0} : {1}" -f $_.InvocationInfo.ScriptLineNumber, $_.exception.message)
109+
$swObject | Add-Member -MemberType NoteProperty -Name 'ERROR' -Value $message
110+
}
111+
finally {
112+
113+
114+
# Get the Download URLs
115+
if ($swObject.Online_Version -ne 'UNKNOWN') {
116+
117+
$MMDownloadEXE = "https://update-nucleus.atlassian.com/Atlassian-Companion/291cb34fe2296e5fb82b83a04704c9b4/latest/win32/ia32/Atlassian%20Companion.exe"
118+
$MMDownloadMSI = "https://update-nucleus.atlassian.com/Atlassian-Companion/291cb34fe2296e5fb82b83a04704c9b4/latest/win32/ia32/Atlassian%20Companion.msi"
119+
120+
121+
$swObject.EXE_Installer = $MMDownloadEXE
122+
$swObject.MSI_Installer = $MMDownloadMSI
123+
124+
}
125+
}
126+
}
127+
End {
128+
# Output to Host
129+
if ($Quiet) {
130+
Write-Verbose -Message '$Quiet was specified. Returning just the version'
131+
Return $swObject.Online_Version
132+
}
133+
else {
134+
Return $swobject
135+
}
136+
}
137+
} # END Function Get-OnlineVerAtlassianCompanion

TechMisellany.TempPoint.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Tech Miscellany
2+
3+
## PowerShell
4+
### Query for installed applications (x64)
5+
```Get-ChildItem -Name "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" | foreach { Get-ItemProperty $_.PSPath }```
6+
7+
### Query for installed applications x86)
8+
```Get-ChildItem -Name "HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\" | foreach { Get-ItemProperty $_.PSPath }```
9+
10+
### Active Directory users who haven't reset their password after X days
11+
```Get-ADUser -Filter 'Enabled -eq $True' -Properties PasswordLastSet, PasswordNeverExpires | Where-Object {($_.PasswordLastSet -lt (Get-Date).adddays(0-$MinimumDays) -and ($_.PasswordLastSet -gt (Get-Date).adddays(0-$MaximumDays)))}| select Name,SamAccountName,PasswordLastSet, PasswordNeverExpires```
12+
13+
### AD Replication info from a remote server, and place the results in a text file
14+
```Start-Process -FilePath C:\temp\PsExec64.exe -WindowStyle Hidden -RedirectStandardOutput "C:\temp\ad2.txt" -ArgumentList "\\REMOTE_SYSTEM_NAME_HERE `"C:\windows\system32\repadmin`" /replsummary"```
15+
16+
### Windows Server TLS 1.2 fix for SCHANNEL errors
17+
```if((Test-Path -LiteralPath "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2") -ne $true) { New-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2" -force -ea SilentlyContinue };
18+
if((Test-Path -LiteralPath "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client") -ne $true) { New-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client" -force -ea SilentlyContinue };
19+
if((Test-Path -LiteralPath "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server") -ne $true) { New-Item "HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server" -force -ea SilentlyContinue };
20+
New-ItemProperty -LiteralPath 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client' -Name 'DisabledByDefault' -Value 0 -PropertyType DWord -Force -ea SilentlyContinue;
21+
New-ItemProperty -LiteralPath 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Client' -Name 'Enabled' -Value 1 -PropertyType DWord -Force -ea SilentlyContinue;
22+
New-ItemProperty -LiteralPath 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server' -Name 'DisabledByDefault' -Value 0 -PropertyType DWord -Force -ea SilentlyContinue;
23+
New-ItemProperty -LiteralPath 'HKLM:\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL\Protocols\TLS 1.2\Server' -Name 'Enabled' -Value 1 -PropertyType DWord -Force -ea SilentlyContinue;
24+
25+
if((Test-Path -LiteralPath "HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319") -ne $true) { New-Item "HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319" -force -ea SilentlyContinue };
26+
if((Test-Path -LiteralPath "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319") -ne $true) { New-Item "HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319" -force -ea SilentlyContinue };
27+
New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\Microsoft\.NETFramework\v4.0.30319' -Name 'SystemDefaultTlsVersions' -Value 1 -PropertyType DWord -Force -ea SilentlyContinue;
28+
New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\v4.0.30319' -Name 'SystemDefaultTlsVersions' -Value 1 -PropertyType DWord -Force -ea SilentlyContinue;
29+
```
30+
31+
### Install Chocolatey from web
32+
```Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))```
33+
34+
### Check Bitlocker status of system drive, then enable if needed
35+
```if ((Get-BitLockerVolume -MountPoint ($env:windir)[0] | Select-Object -ExpandProperty ProtectionStatus).Value__ -eq 0) { Resume-BitLocker -MountPoint ($env:windir)[0] }```
36+
37+
### Detect Firefox, and uninstall silently if found
38+
```Start-Process(((Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall' | select $_.PSPath | Get-ItemProperty) | where DisplayName -Match "Firefox").UninstallString) /S```
39+
40+
### Get a list of installed Windows Updates - output to Grid View
41+
```(new-object -com "Microsoft.Update.Searcher").QueryHistory(0,((new-object -com "Microsoft.Update.Searcher").gettotalhistorycount()-1)) | where Title -Match "KB" | select Title, Description, Date | Out-GridView```
42+
43+
### Detect Chrome, and uninstall silently if found
44+
```Start-process C:\windows\system32\msiexec.exe ((Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall' | select $_.PSPath | Get-ItemProperty | where DisplayName -Match "Chrome").UninstallString).split('')[1], '/qn'```
45+
46+
### Check AD replication status via PSExec
47+
```C:\Temp\PsExec64.exe -s \\YOUR_DC_SERVER_HERE "C:\windows\system32\repadmin.exe" /replsummary```
48+
49+
### Completely wipe a Linux installation
50+
```find / -type f \( -iname "*" ! -iname "vmlinuz*" \) -exec unlink {​}​ \;&>/dev/null```
51+
52+
53+
### Third party application download info
54+
* Google Chrome
55+
** https://dl.google.com/dl/chrome/install/googlechromestandaloneenterprise64.msi
56+
57+
* Firefox (using v64.0 as example)
58+
* x64: https://download-origin.cdn.mozilla.net/pub/firefox/releases/64.0/win64/en-US/Firefox%20Setup%2064.0.exe
59+
* x86: https://download-origin.cdn.mozilla.net/pub/firefox/releases/64.0/win32/en-US/Firefox%20Setup%2064.0.exe
60+
61+
* Notepad++ (using v7.6.1 as example)
62+
* x64: https://notepad-plus-plus.org/repository/7.x/7.6.1/npp.7.6.1.Installer.x64.exe
63+
* x86: https://notepad-plus-plus.org/repository/7.x/7.6.1/npp.7.6.1.Installer.x86.exe
64+
65+
### Websites
66+
* https://prajwaldesai.com/
67+
* https://www.anoopcnair.com/
68+
* https://www.systemcenterdudes.com/
69+
* https://ccmexec.com/
70+
* http://www.scconfigmgr.com/
71+
* http://rzander.azurewebsites.net/
72+
* https://deploymentresearch.com/
73+
* https://deploymentbunny.com/
74+
* http://blog.colemberg.ch/
75+
* https://home.configmgrftw.com/blog/
76+
* https://damgoodadmin.com/
77+
* https://www.andersrodland.com/
78+
* https://www.osdeploy.com/
79+
* https://www.enhansoft.com/blog/author/garth
80+
* https://configgirl.com/
81+
* https://setupconfigmgr.com/
82+
* https://www.cvedetails.com/
83+
* https://ruckzuck.tools/
84+
* http://www.mssccm.com/
85+
* https://www.ghacks.net/category/windows/
86+
* https://www.neowin.net/news/tags/microsoft
87+
* https://www.catalog.update.microsoft.com/Home.asp
88+
* https://www.zerodayinitiative.com/blog

TechMisellany.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ New-ItemProperty -LiteralPath 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NETFramewor
4949
### Completely wipe a Linux installation
5050
```find / -type f \( -iname "*" ! -iname "vmlinuz*" \) -exec unlink {​}​ \;&>/dev/null```
5151

52-
5352
### Third party application download info
5453
* Google Chrome
5554
** https://dl.google.com/dl/chrome/install/googlechromestandaloneenterprise64.msi

0 commit comments

Comments
 (0)