+ Reply to Thread
Results 1 to 3 of 3

Downloaded file By Powershell is corrupted

  1. #1
    Registered User
    Join Date
    11-26-2021
    Location
    pak
    MS-Off Ver
    2010
    Posts
    10

    Downloaded file By Powershell is corrupted

    Dears,
    I am trying to download a file from Gdrive to local drive using powershell; it is working but when i open the file it gives error that file is currupted.

    help plz.

    i used this code;

    Invoke-WebRequest -Uri $source -OutFile $destination

    kindly guide,

    Regards,

  2. #2
    Registered User
    Join Date
    02-21-2023
    Location
    London
    MS-Off Ver
    Microsoft Office 2019 x64
    Posts
    6

    Re: Downloaded file By Powershell is corrupted

    # Create a WebClient to download the file
    $webClient = New-Object System.Net.WebClient

    # Download the file and save it to the local destination
    $webClient.DownloadFile($url, $outputFile)

    # Dispose of the WebClient to release resources
    $webClient.Dispose()
    This script creates a WebClient object, which is specifically designed for downloading files from the internet. It then uses the DownloadFile method to save the file to your local destination.

    Make sure to replace "https your-file-url-here" with the actual URL of the file you want to download, and "C:\path\to\output\file\file.extension" with the path and filename where you want to save the downloaded file.

    This should help ensure that the file is downloaded correctly and not corrupted. If you continue to experience issues, double-check the source URL to make sure it's valid and that the file isn't being modified during the download process.

  3. #3
    Registered User
    Join Date
    02-21-2023
    Location
    London
    MS-Off Ver
    Microsoft Office 2019 x64
    Posts
    6

    Re: Downloaded file By Powershell is corrupted

    after https should go : / / (without spaces)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Recover Damaged Excel File Corrupted By Path/File Access Error
    By SuperShaggy in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2016, 07:20 AM
  2. Corrupted File help please
    By bimo in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-12-2015, 07:01 AM
  3. Powershell code to count data connections and return output to a text file
    By Jack C in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-29-2014, 04:05 AM
  4. Corrupted file
    By Sean Thomas in forum Excel General
    Replies: 0
    Last Post: 01-20-2014, 07:47 AM
  5. Corrupted file
    By gjjh25 in forum Excel General
    Replies: 3
    Last Post: 05-02-2013, 01:58 PM
  6. Corrupted file ?
    By SuitedAces in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-29-2008, 07:52 PM
  7. Corrupted File
    By trini in forum Excel General
    Replies: 0
    Last Post: 03-11-2005, 11:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1