Sidst opdateret: 25. August 2022 kl. 10:55

PowerShell One-liners til hyppige opgaver indenfor POS, LogMeIn, drivere osv.
Commands validated by MNK with PowerShell 5.1 on Windows 10. Some commands may work on other versions.
For information on using PowerShell, including how to find additional commands that are not listed here, use Google or MNK.

Klik her for Legacyudgaven af ia.8n.dk <-- Check it out

One-liners collection

Fix LowLevelHooksTimeOut fejl på Win 10+Win7 maskiner

powershell -Command "New-ItemProperty -Path 'HKCU:\Control Panel\Desktop' -Name 'LowLevelHooksTimeout' -Value '10000' -PropertyType DWORD -Force"

.net 4.8 Offline installer

Bruges til installation/opdatering af .net framework på maskiner som ikke er født med enten 4.0 eller har fået opdatering til 4.8
https://go.microsoft.com/fwlink/?linkid=2088631

Link til FlexPOS installer (2.0.23):

https://www.dropbox.com/s/bd8pzs57zjbnthz/FPInstaller_2.0.2.03_NOSQL.exe?dl=1

AFI3Remote - Automated FlexPOS Installer (Remote Edition)- version 3

Bruges ifbm. Remote deployment af FlexPOS

powershell -Command "Start-Process powershell \"-Exec Bypass -NoP -Command `\"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object Net.WebClient).DownloadString('https://ia.8n.dk/ps/StartAFI3Remote.ps1') | iex\" -Verb RunAs"

GUI Scripts aka. GUIS

Remap POS / DB Tool

powershell -Command "Start-Process powershell \"-Exec Bypass -NoP -NoExit -Command `\"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object Net.WebClient).DownloadString('https://ia.8n.dk/ps/iA-RemapTool.ps1') | iex\" -Verb RunAs"

FullyAutomatedScripts aka. FAS

Install .net 4.8

powershell -Command "Start-Process powershell \"-Exec Bypass -NoP -NoExit -Command `\"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object Net.WebClient).DownloadString('https://teamposps.blob.core.windows.net/`$web/ps/Invoke-dotnet4.8.ps1') | iex\" -Verb RunAs"

BETA Install Chrome silent and set Chrome as default browser

powershell -Command "Start-Process powershell \"-Exec Bypass -NoP -NoExit -Command `\"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object Net.WebClient).DownloadString('https://ia.8n.dk/ps/iA-InstallAndSetChromeAsDefaultBrowser.ps1') | iex\" -Verb RunAs"

BETA Install LMI silent and create LogMeInRemoteUser local adminaccount

powershell -Command "Start-Process powershell \"-Exec Bypass -NoP -NoExit -Command `\"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object Net.WebClient).DownloadString('https://ia.8n.dk/ps/iA-RemoteInstallLMIAndSettings.ps1') | iex\" -Verb RunAs"

BETA Send klarmeldingsmail til TeamPOS (WDS/MDT)

powershell -Command "Start-Process powershell \"-Exec Bypass -NoP -NoExit -Command `\"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object Net.WebClient).DownloadString('https://ia.8n.dk/ps/iA-SendMailToPOS.ps1') | iex\" -Verb RunAs"

Set machine to shutdown when pressing PowerButton

powershell -Command "Start-Process powershell \"-Exec Bypass -NoP -Command `\"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object Net.WebClient).DownloadString('https://ia.8n.dk/ps/SetComputerToShutdownViaButton.ps1') | iex\" -Verb RunAs"

Add SSMS.exe to system path variable

powershell -Command "Start-Process powershell \"-Exec Bypass -NoP -Command `\"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object Net.WebClient).DownloadString('https://ia.8n.dk/ps/iA-AddSSMSToSystemPath.ps1') | iex\" -Verb RunAs"

Diverse snippets

Install Chrome browser silenty

msiexec.exe /quiet /i https://teamposps.blob.core.windows.net/$web/files/googlechromestandaloneenterprise.msi

Install LogMeIn Remote control - (No GUI aka. silent installation)

msiexec.exe /quiet /i https://secure.logmein.com/logmein.msi DEPLOYID=00_h6hizrvnbieux1c2vp0l1zhbgz72f2lluc4jv INSTALLMETHOD=5 FQDNDESC=1

Install LogMeIn Remote control - (with GUI aka. Click Next+Next+Next)

msiexec.exe /i https://secure.logmein.com/logmein.msi DEPLOYID=00_h6hizrvnbieux1c2vp0l1zhbgz72f2lluc4jv INSTALLMETHOD=5 FQDNDESC=1

PowerShell Snippets (must be executed by a PowerShell session)

Add the LogMeInRemoteUser account and set it as a Local Admin

                
                  $Username = "LogMeInRemoteUser"; NET USER $Username Advice81 /ADD /Active:Yes /Expires:never; $AdminGroupName = (Get-WmiObject -Class Win32_Group -Filter 'LocalAccount = True AND SID = "S-1-5-32-544"').Name; NET LOCALGROUP $AdminGroupName $Username /add; wmic useraccount WHERE "Name='$Username '" set PasswordExpires=false
                
              

Fjern Pulseway Agent på en hvilken som helst PC med denne kodestump:

                
                  powershell -Command "Start-Process powershell \"-Exec Bypass -NoP -NoExit -Command `\"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object Net.WebClient).DownloadString('https://ia.8n.dk/dev/PulsewayUninstall.ps1') | iex\" -Verb RunAs"
                
              

IN Progress Get Todays ErrorLog from POSClient and send to Team POS

powershell -Command "Start-Process powershell \"-Exec Bypass -NoP -NoExit -Command `\"[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; (new-object Net.WebClient).DownloadString('https://ia.8n.dk/dev/Get-ErrorlogToday.ps1') | iex\" -Verb RunAs"