Search the Community
Showing results for 'how to powershell'.
Found 446 results
-
Remove Dropbox with PowerShell
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-Item -recurse -force $dir$_$dropM -ErrorAction SilentlyContinue Remove-Item -recurse -force $dir$_$drop -ErrorAction SilentlyContinue Remove-Item -recurse -force $dir$_$StartM -ErrorAction SilentlyContinue Remove-Item -recurse -force $dir$_$Short -ErrorAction SilentlyContinue } C:\Windows\explorer.exe #End
-
Powershell User Context
I am trying to create a PowerShell script that will run DBCC checks on a SQL server and then report status back to Pulseway. I have a working script that I can run from the command line but the script will not run correctly when sent as a Pulseway script. Here are the details. The script fails because it is unable to authenticate to the SQL server. The SQL Server is running on the same machine as I am running the script on. Thus wil are not dealing with cross machine accounts. I have put debug code into the script and the account reported back by PowerShell is MACHINENAME$. The machine is in a domain and thus the script appears to be reporting back the machine account in the domain. This implies to me that when Pulseway runs a script it is using the NT AUTHORITY\SYSTEM account and that the MACHINENAME$ account would then be used for any network access. Is this correct? I have given SQL Server rights to NT AUTHORITY\SYSTEM as well as DOMAIN\MACHINENAME$ and NT AUTHORITY\LOCAL SERVICE. Non of these rights appear to allow me to connect to SQL. Has anyone ever written Powershell code for Pulseway and been able to connect to SQL Server? Any ideas, thoughts or details on the user contexts used by Pulseway would be helpful.
-
PowerShell command to disable the windows update notification
Hi, For many servers I want to disable the 'Send a notification when updates are available with priority' option. I would like to know if there is any PowerShell command which disables this function in the Pulseway Manager (Agent)? Kind regards, Laurens
-
Powershell: "An error occurred when loading the system Windows PowerShell Snap-Ins."
Dear All, I'm having some trouble trying to run Windows Powershell commands via PC Monitor (Android App). When I send any command, I get back the following message: "An error occurred when loading the system Windows PowerShell Snap-Ins. Please contact Microsoft Support Services." This is displayed in the PowerShell terminal window inside the PC Monitor app. Has anyone seen this problem before? Or have any ideas how to fix it? I'm running: - one Windows Vista Home Premium SP2 machine. - one Windows 7 Starter machine. I get exactly the same error message when attempting to send commands to both machines. They both have the .NET framework that came with the install, I've not installed any additions, or any new version of PowerShell. Indeed, the Windows 7 machine is quite new and has few bits of third-party software installed on it. In addition, I run PowerShell scripts from the desktop on both machines without any problems, and with users that are not admins. I've never seen anything like this message on the desktop. Any help would be greatly appreciated. Google has turned up a few things, and I've attempted some of the solutions but with no joy. Simon
-
Powershell Script to automate veeam backup jobs
Hi there, Are there possibility's to create a Powershell script which starts a Veeam backup of a VM which you can add to the Task section? We would like to automate the Windows Updates for the VM's, but before they update we would like to make a backup/snapshot of the VM first.
-
PowerShell Module to manage configuration of Pulseway Manager
A bit of introduction: I'm a happy user of Pulseway Manager. I use Pulseway Manager Enterprise (but for this topic it doesn't really matter). I manage quite large deployment with 250 Pulseway monitored machines. Someone else installed (via GPO) and did some basic setup. After running basic setup for a while, someone else changed some settings and tweaked it a bit. Finally ... again someone said lets change things around... This got me to this point... I have to change: CPU For all servers CPU > 90% for 30minutes > CRITICAL RAM RAM on 1 HOST – 5% for 30 min > CRITICAL Disable Low RAM on VM's Disable Low RAM in Azure Enable storage for any drives the servers have 20GB free > ELEVATED 10GB free > CRITICAL While I could just assign some poor guy to go thru 60+ servers and change things, make sure those are correct I decided it's time to introduce PowerShell for those Active Directory admins out there... while I know there is Pulseway GPO but it's kind of limited, and doesn't give much flexibility (for example drive monitoring). It also overwrites settings set locally without Pulseway actually showing them on Client. After playing a bit... I managed to write: Clear-Host Import-Module PSPulsewayManager -Force ### Tests - Account Page ### Get-PulsewayMaintenanceMode Set-PulsewayMaintenanceMode -Toggle $false -Verbose Get-PulsewayGroupName Set-PulsewayGroupName -GroupName 'EVOTEC' -Verbose Get-PulsewayComputerName Set-PulsewayComputerName -NewComputerName 'EVO1' -Verbose ### Set settings remotly... $Computer = 'AD1' Get-PulsewayMaintenanceMode -Computer $Computer Set-PulsewayMaintenanceMode -Computer $Computer -Toggle $false -Verbose Get-PulsewayGroupName -Computer $Computer Set-PulsewayGroupName -Computer $Computer -GroupName 'EVOTEC' -Verbose Get-PulsewayComputerName -Computer $Computer Set-PulsewayComputerName -Computer $Computer -NewComputerName 'AD1' -Verbose And another tab... Clear-Host Import-Module PSPulsewayManager -Force Import-Module PSWriteColor ### Tests - Notifications Performance Page ### Write-Color ' Get ', 'CPU usage below', ' settings' -Color Yellow, Green, Yellow Get-PulsewayCPUBelow Write-Color ' Get ', 'CPU usage above', ' settings' -Color Yellow, Green, Yellow Get-PulsewayCPUAbove Write-Color ' Get ', 'Memory', ' settings' -Color Yellow, Green, Yellow Get-PulsewayMemoryLow Write-Color ' Get ', 'Port Closed', ' settings' -Color Yellow, Green, Yellow Get-PulsewayMonitoredPortClosed Set-PulsewayCPUAbove -CPUUsagePercentage 25 -CPUUsageTimeInterval 20 -PrioritySendNotificationOnCPUUsage Elevated -SendNotificationOnCPUUsage Enabled -Verbose Set-PulsewayCPUBelow -BelowCPUUsagePercentage 2 -BelowCPUUsageTimeInterval 20 -PrioritySendNotificationOnBelowCPUUsage Elevated -SendNotificationOnBelowCPUUsage Disabled -Verbose Set-PulsewayMemoryLow -LowMemoryPercentage 10 -LowMemoryTimeInterval 15 -PrioritySendNotificationOnLowMemory Critical -SendNotificationOnLowMemory Enabled -Verbose Set-PulsewayMonitoredPortClosed -PortInterval 2 -PrioritySendNotificationOnPortNotAccessible Critical -SendNotificationOnPortNotAccessible Enabled -Verbose And another tab Clear-Host Import-Module PSPulsewayManager -Force Import-Module PSWriteColor $Computer = 'AD1' Write-Color 'Get ', 'Low Disk Space' -Color White, Yellow $Drives = Get-PulsewayLocalDiskSpace -Computer $Computer $Drives Write-Color 'List ', ' drives separatly' -Color White, Yellow -LinesAfter 1 $Drives.MonitoredDrives ## Find all drives for computer/server $FindDrives = Get-Drive -Computer $Computer $FindDrives $ListDrives = @() # Set the settings for all drives for particular computer/server (Elevated) $DrivesElevated = Set-DriveSettings -Drive $FindDrives -Percentage 10 -Priority Elevated -SizeMB 20000 -UsePercentage No # Repeat process for same drives but make it critical $DrivesCritical = Set-DriveSettings -Drive $FindDrives -Percentage 10 -Priority Critical -SizeMB 10000 -UsePercentage No $ListDrives += $DrivesElevated $ListDrives += $DrivesCritical Set-PulsewayLocalDiskSpace -Computer $Computer -Drives $ListDrives -SendNotificationOnLowHDDSpace Enabled -Verbose Since it covers my needs for now I was wondering if there is any interest in this? I don't want to spend time on it if there's no one else needing this I've published it on github https://github.com/EvotecIT/PSPulsewayManager But its also published in PowerShellGallery which allows you to install it .... Install-Module PSPulsewayManager Import-Module PSPulsewayManager Use the commands.. Keep in mind I've not spent a ton of time on it. There are bugs, some things are not checked.. but it does work ;-)
-
Impersonation for Backup Monitoring
Hello, I am just trying to get this setup to monitor the backups on a 2012 R2 server. I see this article but I have some confusion on what needs done. How to enable and configure the Windows Server Backup monitoring | Pulseway Help Center (intercom.help) User in “Backup Operators” or “Administrators” user group configured in Pulseway Manager at PowerShell impersonation. Note: PowerShell Impersonation Setup Instructions are covered at Runtime Configuration. Not sure what it means by setup instructions are covered at runtime. I am currently using the domain admin account for settings things up. I am not sure on the "configured in Pulseway Manager at PowerShell impersonation" either. Thanks in advance.
-
Install MalwareBytes with PowerShell
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 } # Download the installer $source = "https://data-cdn.mbamupdates.com/web/mb3-setup-consumer-3.0.6.1469.exe" $destination = "$workdir\mbam.exe" Invoke-WebRequest $source -OutFile $destination # Start the installation Start-Process -FilePath "$workdir\mbam.exe" -ArgumentList "/NOCANCEL /NORESTART /VERYSILENT /SUPPRESSMSGBOXES" # Wait XX Seconds for the installation to finish Start-Sleep -s 35 # Remove the installer rm -Force $workdir\mbam* For Windows 7 please change $source = "https://data-cdn.mbamupdates.com/web/mb3-setup-consumer-3.0.6.1469.exe" $destination = "$workdir\mbam.exe" Invoke-WebRequest $source -OutFile $destination To $WebClient = New-Object System.Net.WebClient $WebClient.DownloadFile("https://data-cdn.mbamupdates.com/web/mb3-setup-consumer-3.0.6.1469.exe","$workdir\mbam.exe") Since Powershell in Windows 7 does not support the Invoke-WebRequest
-
HELP - Successfully runs the Enable SSO PowerShell script via Pulseway RMM, but does not execute on the endpoint
It is vital to comprehend the difference in execution context between testing in Powershell ISE and using the Pulseway agent. While testing with Powershell ISE is done under a specific user account, Pulseway runs scripts as Local System. This variation may cause keys to be written to the physical registry location for Current Users after successful execution.sso login
-
Configure Powershell Impersonation remotely
Is there anyway to configure powershell impersonation remotely? I am trying to run a few different powershell scripts and I'm getting access denied. I assume BC it's running as system. Is there a way around this ? Or a way to configure this option remotely? This is the script I'm trying to run. It runs fine under my account. Import-Module ActiveDirectory Get-ADComputer -Filter {OperatingSystem -Like "Windows 7*"} | foreach {restart-computer $_.name -force} Thanks in advance
-
We need a real powershell dialogue in pulseway
Hi there, do you consider to improve the powershell feature? The Problem here is, that you can only start commands, which don't need any answer. If an answer is required, the command is not beeing executed - regardless you will give the answer within the next command. It is no real "bi-directional' powershell session like "enter-pssession -computername xxx', which is needed for our daily work. So we have to use vpn instead or rdp - both are not the fastest way to execute commands. In kaseya vsa we have this feature working as needed. I think the Pulseway Agent could handle it - when I have a look to remote desktop feature, which is nearly real time.
-
Powershell Scripts Not working
Can someone tell me why this script works locally from the server but not from Pulseway. I've tested running the script both with impersonation enabled and disabled. Both tests were done on server 2012 R2. One with default Powershell version and one with 5.1. This script runs perfectly fine from the server itself just not through pulseway. I have several scripts that give the same type of error. I'd appreciate any help so I can figure this out. It seems like Pulseway doesn't like certain characters? ForEach ($COMPUTER in (Get-ADComputer -Filter '*' | Select -ExpandProperty Name)) { $key = “SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update\Results\Install” $keytype = [Microsoft.Win32.RegistryHive]::LocalMachine $RemoteBase = [Microsoft.Win32.RegistryKey]::OpenRemoteBaseKey($keytype,$Server) $regKey = $RemoteBase.OpenSubKey($key) $KeyValue = $regkey.GetValue(”LastSuccessTime”) $System = (Get-Date -Format "yyyy-MM-dd hh:mm:ss") if ($KeyValue -lt $System) { Write-Host " " Write-Host $computer "Last time updates were installed was: " $KeyValue } } This is what it looks like when ran from the server without involving pulseway
-
PowerShell User Impersonation Fail
Hi guys, I'm getting a "User impersonation returned error 1326" whilst attempting to run PowerShell commands on a several Win10 machines. Now, I know I've tested the PowerShell impersonation on these machines when they were deployed, so it's not a credentials problem. Have searched the forums but can't see a solution. Thanks,
-
Unitrends Backup Agent
I've recently disabled powershell.exe for users to run directly and was notified by those users that they've seen a Windows Script Host error. The error is C:\PCBP\UnitrendsScripts\ApplySambaCredentials.vbs, line 14. That line leads back to a call on powershell.exe to run ManageSambaCredentials.ps1. Since this is the only change I've made in recent memory that would cause this behavior, is it not possible to run Unitrends Backup Agent if powershell.exe is disabled for the user? The comment in the .vbs states "This script is necessary so the ManageSambaCredentials.ps1 powershell script call be called by the system with no visible window." Any information about this would be appreciated.
-
Install Adobe Reader DC with PowerShell
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 } # Download the installer $source = "http://ardownload.adobe.com/pub/adobe/reader/win/AcrobatDC/1502320053/AcroRdrDC1502320053_en_US.exe" $destination = "$workdir\adobeDC.exe" Invoke-WebRequest $source -OutFile $destination # Start the installation Start-Process -FilePath "$workdir\adobeDC.exe" -ArgumentList "/sPB /rs" # Wait XX Seconds for the installation to finish Start-Sleep -s 35 # Remove the installer rm -Force $workdir\adobe* For Windows 7 please change $source = "http://ardownload.adobe.com/pub/adobe/reader/win/AcrobatDC/1502320053/AcroRdrDC1502320053_en_US.exe" $destination = "$workdir\adobeDC.exe" Invoke-WebRequest $source -OutFile $destination To $WebClient = New-Object System.Net.WebClient $WebClient.DownloadFile("http://ardownload.adobe.com/pub/adobe/reader/win/AcrobatDC/1502320053/AcroRdrDC1502320053_en_US.exe","$workdir\adobeDC.exe") Since Powershell in Windows 7 does not support the Invoke-WebRequest
-
Install CCleaner with PowerShell
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:\Program Files\CCleaner\CCleaner.exe" -ArgumentList "/CLEANER /AUTO" Start-Sleep -s 20 This will do a Auto Clean with CCleaner You can add this to Scripts as a PowerShell Script.
-
Install Calibre Ebook Manager with PowerShell
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 installation msiexec.exe /i "$workdir\calibre.msi" /q # Wait XX Seconds for the installation to finish Start-Sleep -s 35 # Remove the installer rm -Force $workdir\c* For Windows 7 please change $source = "https://calibre-ebook.com/dist/win32" $destination = "$workdir\calibre.msi" Invoke-WebRequest $source -OutFile $destination To $WebClient = New-Object System.Net.WebClient $WebClient.DownloadFile("https://calibre-ebook.com/dist/win32","$workdir\calibre.msi") Since Powershell in Windows 7 does not support the Invoke-WebRequest
-
Install Skype with PowerShell
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 # Start the installation Start-Process -FilePath "$workdir\skype.exe" -ArgumentList "/VERYSILENT /SP- /NOCANCEL /NORESTART /SUPPRESSMSGBOXES /NOLAUNCH" # Wait XX Seconds for the installation to finish Start-Sleep -s 60 # Remove the installer rm -Force $workdir\skype* For Windows 7 please change $source = "http://www.skype.com/go/getskype-full" $destination = "$workdir\skype.exe" Invoke-WebRequest $source -OutFile $destination To $WebClient = New-Object System.Net.WebClient $WebClient.DownloadFile("http://www.skype.com/go/getskype-full","$workdir\skype.exe") Since Powershell in Windows 7 does not support the Invoke-WebRequest
-
Install Google Chrome with PowerShell
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 $workdir -PathType Container) { Write-Host "$workdir already exists" -ForegroundColor Red} ELSE { New-Item -Path $workdir -ItemType directory } # Download the installer $source = "https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B03FE9563-80F9-119F-DA3D-72FBBB94BC26%7D%26lang%3Den%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26ap%3Dx64-stable/dl/chrome/install/googlechromestandaloneenterprise64.msi" $destination = "$workdir\chrome.msi" Invoke-WebRequest $source -OutFile $destination # Start the installation msiexec.exe /i "$workdir\chrome.msi" /q /norestart # Wait XX Seconds for the installation to finish Start-Sleep -s 35 # Remove the installer rm -Force $workdir\chrome* For Windows 7 please change $source = "https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B03FE9563-80F9-119F-DA3D-72FBBB94BC26%7D%26lang%3Den%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26ap%3Dx64-stable/dl/chrome/install/googlechromestandaloneenterprise64.msi" $destination = "$workdir\chrome.msi" Invoke-WebRequest $source -OutFile $destination To $WebClient = New-Object System.Net.WebClient $WebClient.DownloadFile("https://dl.google.com/tag/s/appguid%3D%7B8A69D345-D564-463C-AFF1-A69D9E530F96%7D%26iid%3D%7B03FE9563-80F9-119F-DA3D-72FBBB94BC26%7D%26lang%3Den%26browser%3D4%26usagestats%3D0%26appname%3DGoogle%2520Chrome%26needsadmin%3Dprefers%26ap%3Dx64-stable/dl/chrome/install/googlechromestandaloneenterprise64.msi","$workdir\chrome.msi") Since Powershell in Windows 7 does not support the Invoke-WebRequest
-
Install Winrar with PowerShell
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 = "$workdir\winrar.exe" Invoke-WebRequest $source -OutFile $destination # Start the installation Start-Process -FilePath "$workdir\winrar.exe" -ArgumentList "/S" # Wait XX Seconds for the installation to finish Start-Sleep -s 35 # Remove the installer rm -Force $workdir\w* For Windows 7 please change $source = "http://rarlab.com/rar/winrar-x64-540.exe" $destination = "$workdir\winrar.exe" Invoke-WebRequest $source -OutFile $destination To $WebClient = New-Object System.Net.WebClient $WebClient.DownloadFile("http://rarlab.com/rar/winrar-x64-540.exe","$workdir\winrar.exe") Since Powershell in Windows 7 does not support the Invoke-WebRequest
-
Install FireFox with PowerShell
I made a install script for CCleaner to do a Silent install and clean if needed. Improvements are welcome! When a new version of FireFox comes out, just change the firefox version or url to the new value. # Silent Install Firefox # Download URL: https://www.mozilla.org/en-US/firefox/all/ # 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://download.mozilla.org/?product=firefox-51.0.1-SSL&os=win64&lang=en-US" $destination = "$workdir\firefox.exe" # Check if Invoke-Webrequest exists otherwise execute WebClient if (Get-Command 'Invoke-Webrequest') { Invoke-WebRequest $source -OutFile $destination } else { $WebClient = New-Object System.Net.WebClient $webclient.DownloadFile($source, $destination) } # Start the installation Start-Process -FilePath "$workdir\firefox.exe" -ArgumentList "/S" # Wait XX Seconds for the installation to finish Start-Sleep -s 35 # Remove the installer rm -Force $workdir\firefox*
-
Group Terminal or Powershell
Hi, Please can you add a Group Task for Terminal or Powershell. You already have the option to for the above on individual devices. Can you not just enable it so it will repeat the task on all devices in the group? This would give so much power to IT admins wanting to update lots of PCS in a group. At the moment we have to go into each PC to run the Terminal or Powershell command. Thanks Phil
-
Error with Powershell Script
I'm not sure this is the correct section to post in, but I am having issues with a sample script I wrote. In testing out the automation features of Pulseway, I wrote a script to start the PC Monitor service (because I am having issues with it not starting all of the time). Here is the script: Get-Service "PC Monitor" | Where {$_.status –eq 'Stopped'} | Start-Service Here is the error I get in return : At C:\Program Files\Pulseway\automation_a5487285_b624_4996_8bc3_3440ed567e5a.ps1:1 char:47 + ... ice "PC Monitor" | Where {$_.status ƒ?"eq 'Stopped'} | Start-Service + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The string is missing the terminator: ". At C:\Program Files\Pulseway\automation_a5487285_b624_4996_8bc3_3440ed567e5a.ps1:1 char:45 + ... ice "PC Monitor" | Where {$_.status ƒ?"eq 'Stopped'} | Start-Service + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Unexpected token 'ƒ?"eq 'Stopped'} | Start-Service' in expression or statement. At C:\Program Files\Pulseway\automation_a5487285_b624_4996_8bc3_3440ed567e5a.ps1:1 char:34 + Get-Service "PC Monitor" | Where {$_.status ƒ?"eq 'Stopped'} | Start ... + ~ Missing closing '}' in statement block or type definition. + CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordEx ception + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString It appears that the -eq is somehow being changed to f?"eq . Does anyone know why this is happening, or am I misinterpreting this? Any help would be appreciated.
-
Using chocolatey in Powershell
Hello, I have found that running chocolatey install or uninstall commands via Powershell through the webapp results in the client showing "offline" in Pulseway. I have experienced this with Windows 7 Professional and Windows 10 Enterprise. After checking the system I dont see any errors in the Application or systems logs and the Pulseway service is still running. I used a command like this "choco install skype -y" which should just install the skype package from the chocolatey repository. After restarting the pulseway service on the client it appears online again, but for me this is quite a problem since I update third party packages via remote powershell and chocolatey. Thanks Dan
-
The system cannot find the path specified
Hi, I am new to pulseway. Have written the following PowerShell script which works fine on my test machine. Clear-RecycleBin -Force However when run from pulse way it reports the script has run successfully but nothing is deleted from the recycle bin. The following error is shown in execution details: Clear-RecycleBin : The system cannot find the path specified At C:\Program Files\Pulseway\automation_b6682084_076f_4d67_80a0_0200e70e0897.ps1:1 char:1 + Clear-RecycleBin -Force + ~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (RecycleBin:String) [Clear-RecycleBin], Win32Exception + FullyQualifiedErrorId : FailedToClearRecycleBin,Microsoft.PowerShell.Commands.ClearRecycleBinCommand I have tried: cd \ Clear-RecycleBin -Force But same results. Is this a permission issue, that does not allow the script to run ?