Jump to content
Pulseway 9.14 🔥

PowerShell

Share your PowerShell scripts

  1. Started by kavaa,

    Here is a script to remove Dropbox with PowerShell. Be aware that your Dropbox could also be removed. #Script to remove Dropbox #This May remove your dropbox folder contents form your computer #By: Enrique Sanchez #Dropbox Paths $Dir = "C:\Users\" $drop = "\Appdata\Roaming\Dropbox" $dropM = "\Appdata\Roaming\DropboxMaster" $DropD = "\Dropbox" $StartM = "\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Dropbox" $Short = "\Desktop\Dropbox.lnk" #Kill related processes taskkill /im dropbox.exe /f taskkill /im explorer.exe /f Get-ChildItem -name c:\users | foreach ($_) { Remove-Item -recurse -force $Dir$_$dropD -ErrorAction SilentlyContinue Remove-…

    • 1 reply
    • 14.4k views
  2. Started by kavaa,

    I made a install script for Dropbox to do a Silent install. UPDATED VERSION 2 With auto detect if Invoke-WebRequest exists Improvements are welcome! Change the version if needed in the Source URL: https://www.dropbox.com/downloading?full=1&os=win # Silent Install Dropbox # Download URL: https://www.dropbox.com/downloading?full=1&os=win # Path for the workdir $workdir = "c:\ictwebsolution\" # Check if work directory exists if not create it If (Test-Path -Path $workdir -PathType Container) { Write-Host "$workdir already exists" -ForegroundColor Red} ELSE { New-Item -Path $workdir -ItemType directory } # Download the installer $so…

    • 2 replies
    • 9.6k views
  3. Started by kavaa,

    I made a install script for MalwareBytes to do a Silent install. UPDATED VERSION 2 With auto detect if Invoke-WebRequest exists Improvements are welcome! Change the version if needed in the Source URL: https://data-cdn.mbamupdates.com/web/mb3-setup-consumer-3.0.6.1469.exe # Silent Install MalwareBytes # Download URL: https://www.malwarebytes.com/mwb-download/thankyou/ # Path for the workdir $workdir = "c:\installer\" # Check if work directory exists if not create it If (Test-Path -Path $workdir -PathType Container) { Write-Host "$workdir already exists" -ForegroundColor Red} ELSE { New-Item -Path $workdir -ItemType directory …

  4. Started by kavaa,

    I made a install script for Google Chrome to do a Silent install. UPDATED VERSION 2 With auto detect if Invoke-WebRequest exists Improvements are welcome! When a new version of Google Chrome comes out follow this url: https://enterprise.google.com/chrome/chrome-browser/ Next find the download button -> Right click on the download button and choose Copy Download Location paste it in the script and it will download the latest version. # Silent Install Chrome # https://enterprise.google.com/chrome/chrome-browser/ # Path for the workdir $workdir = "c:\installer\" # Check if work directory exists if not create it If (Test-Path -Path $wor…

    • 1 reply
    • 23.2k views
  5. Started by kavaa,

    I made a install script for Adobe Reader DC to do a Silent install. UPDATED VERSION 2 With auto detect if Invoke-WebRequest exists Improvements are welcome! Change the version if needed in the Source URL: http://ardownload.adobe.com/pub/adobe/reader/win/AcrobatDC/1502320053/AcroRdrDC1502320053_en_US.exe # Silent install Adobe Reader DC # https://get.adobe.com/nl/reader/enterprise/ # Path for the workdir $workdir = "c:\installer\" # Check if work directory exists if not create it If (Test-Path -Path $workdir -PathType Container) { Write-Host "$workdir already exists" -ForegroundColor Red} ELSE { New-Item -Path $workdir -ItemType directory …

  6. Started by kavaa,

    I made a install script for Skype to do a Silent install. UPDATED VERSION 2 With auto detect if Invoke-WebRequest exists Improvements are welcome! # Silent Install Skype # https://www.skype.com/en/download-skype/skype-for-windows/ # Path for the workdir $workdir = "c:\installer\" # Check if work directory exists if not create it If (Test-Path -Path $workdir -PathType Container) { Write-Host "$workdir already exists" -ForegroundColor Red} ELSE { New-Item -Path $workdir -ItemType directory } # Download the installer $source = "http://www.skype.com/go/getskype-full" $destination = "$workdir\skype.exe" Invoke-WebRequest $source -OutFile $destination # Sta…

    • 1 reply
    • 15.8k views
  7. I made a install script for Calibre to do a Silent install. UPDATED VERSION 2 With auto detect if Invoke-WebRequest exists Improvements are welcome! # Silent Install Calibre # https://calibre-ebook.com/download # Path for the workdir $workdir = "c:\installer\" # Check if work directory exists if not create it If (Test-Path -Path $workdir -PathType Container) { Write-Host "$workdir already exists" -ForegroundColor Red} ELSE { New-Item -Path $workdir -ItemType directory } # Download the installer $source = "https://calibre-ebook.com/dist/win32" $destination = "$workdir\calibre.msi" Invoke-WebRequest $source -OutFile $destination # Start the inst…

  8. Started by kavaa,

    I made a install script for Winrar to do a Silent install. UPDATED VERSION 2 With auto detect if Invoke-WebRequest exists Improvements are welcome! When a new version of Winrar comes out, just change the winrar-x64-540.exe to the new value. # Silent Install Winrar # http://www.winrar.com # Path for the workdir $workdir = "c:\installer\" # Check if work directory exists if not create it If (Test-Path -Path $workdir -PathType Container) { Write-Host "$workdir already exists" -ForegroundColor Red} ELSE { New-Item -Path $workdir -ItemType directory } # Download the installer $source = "http://rarlab.com/rar/winrar-x64-540.exe" $destination …

  9. Started by kavaa,

    I made a install script for CCleaner to do a Silent install and clean if needed. UPDATED VERSION 3 With auto detect if Invoke-WebRequest exists Improvements are welcome! When a new version of CCleaner comes out, just change the ccsetup526 to the new value. # CCleaner Download / Update Location # http://www.piriform.com/ccleaner/download mkdir C:\CCleanerInstall Invoke-WebRequest http://download.piriform.com/ccsetup526.exe -OutFile C:\CCleanerInstall\ccsetup526.exe Start-Process -FilePath "c:\CCleanerInstall\ccsetup526.exe" -ArgumentList "/S" Start-Sleep -s 20 rm-R -Force C:\CCleanerInstall If you want you can also add: Start-Process -FilePath "C…

    • 2 replies
    • 11.4k views
  10. Windows will sometimes refuse to start non-critical services on boot (eg. Pulseway), when resources are low. I've noticed a few Win7 machines have run for weeks without Pulseway being allowed to start. As the powershell cmdlet "Set-Service –Name –Computer -StartupType" doesn't seem to allow delayed-start, I'm using this script as a work-around. You'll need to manually stop the service before running this script and then manually re-start it afterwards. I have NOT thoroughly tested this script and I take no credit or responsibility for it - it is something that I poached and re-factored and I'm not experienced in PowerShell. Regards, Delay PC Monitor service s…

    • 0 replies
    • 3.6k views
  11. Started by PaulWTech,

    The Pulseway Automation contains the Builtin "Cleanup Temporary Files" powershell. I thought it might be worth a conversation. Here's the current code: $folders = @("C:\Windows\Temp\*", "C:\Documents and Settings\*\Local Settings\temp\*", "C:\Users\*\Appdata\Local\Temp\*", "C:\Users\*\Appdata\Local\Microsoft\Windows\Temporary Internet Files\*", "C:\Windows\SoftwareDistribution\Download", "C:\Windows\System32\FNTCACHE.DAT") foreach ($folder in $folders) {Remove-Item $folder -force -recurse -ErrorAction SilentlyContinue} exit 0 I'm not sure it is worth removing the SoftwareDistribution\Download files? From what I understand in Windows 10 you have to run, net stop…

    • 0 replies
    • 9.3k views
  12. Started by pat,

    Hi, I am trying to automate the run of disk clean-up tool (cleanmgr) on my managed computers. I have created a script that prepares the "sageset" on computers and that seems to be working OK. The problem I am running into is that when I remotely launch the script/1-liner that executes the cleanmgr to effectively run the created sageset, it just hangs while using a certain percentage of CPU. Do you have any idea what I'm doing wrong? prepare.sageset.ps1: this prepares the "sageset" in registry. I'm using sageset 0x0100. run.cleanup.ps1: this starts the "sagerun". It works just fine when executed manually from powershell but I'm running into the above-descrip…