CCleaner未使用PowerShell命令下载 [英] CCleaner is not downloading with PowerShell commands

查看:43
本文介绍了CCleaner未使用PowerShell命令下载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试通过此命令行使用PowerShell下载CCleaner.我只能看到一个安装文件正在下载,但不是来自CCleaner.

I tried to download CCleaner using PowerShell with this command line. All I can see is a setup file is download but it is not from CCleaner.

powershell.exe -ExecutionPolicy Bypass -Command "(New-Object System.Net.WebClient).DownloadFile('https://www.ccleaner.com/ccleaner/download/standard/', (New-Object -ComObject Shell.Application).NameSpace('shell:Downloads').Self.Path + '\CCleanerUpdated.exe')"

推荐答案

我创建了一个Powershell脚本: Download_CCleaner.ps1 ,可以通过批处理文件启动它:

I created a Powershell script : Download_CCleaner.ps1 that can be launched by a batch file :

Download_CCleaner.ps1

cls
$start_time = Get-Date
$Folder = "$PSScriptRoot\DownloadFolder\"
# We create a SubFolder Named "DownloadFolder" in the same path of the script if it doesn't exists yet !
If ((Test-Path -Path $Folder) -eq 0) { New-Item -Path $Folder -ItemType Directory | Out-Null }
$url = "https://download.ccleaner.com/ccsetup578.exe"
$output = $Folder + $url.Split("/")[-1]
Write-Host "`r`n          Please Wait a While ... Downloading CCleaner is in Progress ..."
Invoke-WebRequest -Uri $url -OutFile $output
$Elapsed_Time = "$((Get-Date).Subtract($start_time).Minutes) Minutes(M) : $((Get-Date).Subtract($start_time).Seconds) Secondes(s)"
cls
Write-Host "`r`n          Running Script Time taken is : $Elapsed_Time"


Download_CCleaner.bat

@echo off
Title CCleaner Downloader by Hackoo 2021
cls & Mode 85,7 & color 9E
echo(
echo        Please Wait a While ... Trying to Download CCleaner ... 
Powershell -NoLogo -ExecutionPolicy Bypass -C "./Download_CCleaner.ps1"
Timeout /T 10 /NoBreak>nul

这篇关于CCleaner未使用PowerShell命令下载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆