pbatard / fido Goto Github PK
View Code? Open in Web Editor NEWA PowerShell script to download Windows or UEFI Shell ISOs
License: GNU General Public License v3.0
A PowerShell script to download Windows or UEFI Shell ISOs
License: GNU General Public License v3.0
There is no need to run the JavaScript that is on the software-download pages. The API can be used by providing any UUID as Session ID. Doing so also seems to prevent the permaban.
Because I don't know PowerShell, as example I have quickly modified my very old bash script that works with the software-download API.
https://gist.github.com/whatever127/1018f7390e076a23a960d478e12c0d9e
Getting Invalid JSON primitive: IsoX64
I understand that this is primarily for Rufus, but I'm in need of being able to directly download the appropriate ISOs from a command line to aid in command-line based Win10 upgrades on the active device. The CLI syntax should require the answers to each selection as an argument, or even assume the values for the current installation with optional overrides.
Something like:
powershell -ExecutionPolicy bypass .\Fido.ps1 -version 10 -release "20H1" -edition "home/pro" -locale "en-US" -architecture "x64"
powershell -ExecutionPolicy bypass .\Fido.ps1 -assumecurrent -release "1909"
The error message is as follows:
Error
OK button
Error: The response could not be parsed because the Internet Explorer engine is not available or the initial startup configuration of Internet Explorer is incomplete. Please specify the UseBasicParsing parameter and try again.
testing message:
Microsoft Windows [version 10.0.19042.746]
Browser Information:
google chrome version 90.0.4412.5 dev (64 bit)
Microsoft Edge version 88.0.705.68 (64 bit)
Microsoft Edge version 90.0.789.1 dev (64 bit
thanks
This only seems to occur when Fido is launched for a Russian locale (such as from Rufus when the application language is set to Russian).
If you try to select Windows 10
→ 1703 [Redstone 2] (Build 15063.0 - 2017.03)
→ Windows 10 Single Language
→ Русский
(Russian) you get the following:
Error: Cannot convert value "<inputs><INPUT value='{"Name": "Windows 10 для одного языка Русский","Uri": "https://software-download.microsoft.com/pr/Win10_1703_SingleLang_Russian_x64.iso?t=da557197-7f05-40fe-9bb5-c7ad2cef6cac&e=1574507371&h=d98da6a97a0b3c0c60fdf7ae06d9fae4","ProductDisplayName": "Windows 10 1703 Single Language Russian","Language": "Russian","LocalizedLanguage": "Русский","LocalizedProductDisplayName": "Windows 10 для одного языка Русский","DownloadType": "x64" }'/> <INPUT value='{"Name": "Windows 10 для одного языка Русский","Uri": "https://software-download.microsoft.com/pr/Win10_1703_SingleLang_Russian_x32.iso?t=da557197-7f05-40fe-9bb5-c7ad2cef6cac&e=1574507371&h=51b0e42a46d0980778709c638a4abb68","ProductDisplayName": "Windows 10 1703 Single Language Russian","Language": "Russian","LocalizedLanguage": "Русский","LocalizedProductDisplayName": "Windows 10 для одного языка Русский","DownloadType": "x86" }'/></inputs>" to type "System.Xml.XmlDocument". Error: "Reference to undeclared entity 'nbsp'. Line 1, position 43."
When using el-GR
as the locale the following exception will be raised during the language XML conversion:
Error: Cannot convert value "<options><OPTION value="">Î?Ï?ιλέξÏ?ε μία</OPTION> <OPTION value='{"id":"7611","language":"English"}'>(...)" to type "System.Xml.XmlDocument".
Error: "Reference to undeclared entity 'shy'. Line 1, position 37."
So My Username contains a space so when I'm using it along with Rufus it doesnt Work
Here's What Log has to say:
Downloading https://github.com/pbatard/Fido/releases/download/v1.12/Fido.ps1.lzma
File length: 7.3 KB
Successfully downloaded 'Fido.ps1.lzma'
Signature is valid ✓
Processing -File 'C:\Users\Ruthless' failed because the file does not have a '.ps1' extension. Specify a valid Windows PowerShell script file name, and then try again.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Exited download script with code: -196608
Hi there.
I was curious how to find versions of ISO images downloaded by fido
script I tested to deploy OS and found strange things that image versions did not match the latest.
> Fido.ps1 -Win 10 -Lang ru
No release specified (-Rel). Defaulting to '21H2 (Build 19044.1288 - 2021.11)'.
No edition specified (-Ed). Defaulting to 'Windows 10 Home/Pro/Edu'.
No architecture specified (-Arch). Defaulting to 'x64'.
Selected: Windows 10 21H2 (Build 19044.1288 - 2021.11), Home/Pro/Edu, Russian, [x64]
Downloading 'Win10_21H2_Russian_x64.iso' (5,0 GB)...
> Fido.ps1 -Win 10 -Lang en
No release specified (-Rel). Defaulting to '21H2 (Build 19044.1288 - 2021.11)'.
No edition specified (-Ed). Defaulting to 'Windows 10 Home/Pro/Edu'.
No architecture specified (-Arch). Defaulting to 'x64'.
Selected: Windows 10 21H2 (Build 19044.1288 - 2021.11), Home/Pro/Edu, English, [x64]
Downloading 'Win10_21H2_English_x64.iso' (5,0 GB)...
The script reports that the expected version would be 19044.1288
.
> Get-WindowsImage -ImagePath "C:\Software\Windows\wiso\sources\install.wim" -name 'Windows 10 Pro'
ImageIndex : 4
ImageName : Windows 10 Pro
ImageDescription : Windows 10 Pro
ImageSize : 15 022 256 793 bytes
WIMBoot : False
Architecture : x64
Hal :
Version : 10.0.19041.1288
SPBuild : 1288
SPLevel : 0
EditionId : Professional
InstallationType : Client
ProductType : WinNT
ProductSuite : Terminal Server
SystemRoot : WINDOWS
DirectoryCount : 27649
FileCount : 101885
CreatedTime : 06-10-2021 16:45:34
ModifiedTime : 06-10-2021 21:10:49
Languages : ru-RU (Default)
> Get-WindowsImage -ImagePath "C:\Software\Windows\wiso\sources\install.wim" -name 'Windows 10 Pro'
ImageIndex : 6
ImageName : Windows 10 Pro
ImageDescription : Windows 10 Pro
ImageSize : 15 071 438 212 bytes
WIMBoot : False
Architecture : x64
Hal :
Version : 10.0.19041.1288
SPBuild : 1288
SPLevel : 0
EditionId : Professional
InstallationType : Client
ProductType : WinNT
ProductSuite : Terminal Server
SystemRoot : WINDOWS
DirectoryCount : 26760
FileCount : 99385
CreatedTime : 06-10-2021 17:06:00
ModifiedTime : 06-10-2021 21:22:01
Languages : en-US (Default)
DISM app and Get-WindowsImage report the same: 19041.1288
.
Versions obtained by MediaCreationTool21H2.exe
are 19044.1288
.
The same is correct for Windows 11 as well.
For temporarily I had to switch back to MediaCreationTool.
A little optimization.
Invoke-WebRequest
shows a progress bar by default (for each byte). But it takes TOO much time.
Hiding a progress bar significantly reduces overall runtime.
$progressPreference = 'silentlyContinue'
Hello.
I've an error using Fido v=1.36 when I try to download Windows 11 & Windows 10.
Can't retrieve architectures from server
Windows 7 can still be downloaded.
UPD: I'm not in russia. I do not use VPN. I'm not trying to download russian version of Windows.
Hello,
This is not an issue, your script works like a charm.
Could you please say where do you obtain the Windows edition ID ($winEditionId) from? That is a number after edition label.
@(
"21H2 (Build 19044.1288 - 2021.11)",
@("Windows 10 Home/Pro/Edu", 2084),
@("Windows 10 Home China ", ($zh + 2085))
),
The 7601.24214.180801-1700.win7sp1_ldr_escrow_CLIENT...
Windows 7 ISOs that Microsoft provided at https://download.microsoft.com/download/ appear to have been removed.
We should therefore remove Windows 7 ISO downloads from Fido.
Thank you for the script is it possible to ad Enterprise Edtion as it only allows for Home/Pro/Edu
As happened in the past (#41), it appears that Microsoft have once again altered their ISO download service to make it more difficult for third party applications to use them.
As a result, you may currently be getting Error: We are unable to complete your request at this time / Code 715-123130
or Error: Could not retrieve architectures from server
when using Fido.
We are currently investigating it.
If this download script helped you in the past and you are familiar with troubleshooting web services (Fido basically duplicates what one achieves by visiting https://www.microsoft.com/en-US/software-download/windows11), you are also encouraged to investigate the issue.
When I tried to download Windows 11 22H2, I got the following output:
Selected: Windows 11 22H2 (Build 22621.382 - 2022.09), Home/Pro/Edu, English International, [x64]
Error: The remote server returned an error: (400) Bad Request.
It seems to be a problem with remote server, not download script. It works fine when downloading 21H2.
Here is the Windows 10 LTSC. (Not evaluation, but real ISO's.)
Hi, Author!
First of all - thank you very much for the tool!
Is it possible to expand the list of the images with all the other editions for Windows 7 and for any languages?
Hello there.
Attempting to download French Canadian and Chinese traditional ISOs, however it says invalid Windows language provided or it downloads the simplified version in the case of Chinese.
Options tried:
-Lang "Chinese (Traditional)"
-Lang Chinese (Traditional)
-Lang "Chinese Traditional"
-Lang "French Canada"
-Lang FrenchCanadian
-Lang "French (Canada)"
Download works through Rufus, not sure what the proper argument is, as a copy paste from what -Lang List
provides does not work for this case (and I assume others like Spanish, which I haven't tested)
Per pbatard/rufus#2026 The fix for #41 (adding -Headers @{ 'Referer' = 'https://www.microsoft.com/software-download/windows11' }
to Invoke-WebRequest
) does not seem to be compatible with older versions of PowerShell, such as the ones used on Windows 7.
At this stage, I am not planning to try to fix this (it's just not worth the effort) but instead disable the ability to run Fido on platforms where Invoke-WebRequest
cannot set the Referer
property through the -Headers @{ ... }
method.
I am however opening this issue so that people who run into this error can find it, and to give them a chance to propose a fix before I disable the script on their platform, if they really want to still be able to run it there...
The title pretty much says it all. I have stumbled across this repository and just wondered if the code can somehow be changed to also include ARM ISOs.
can you please add option to download linux such as , ubuntu , centos , kali iso download in the script?
how to use this script in web application
Did Microsoft change something on their servers?
This used to work fine before, but now when reporting the languages from a non western request (e.g. if you set $Locale = "ru-RU"
) you get unprocessed characters.
And it's certainly not with the ability of our script to display Unicode, as we have no trouble with field headers and whatnot:
I was trying to recreate this script in python and I used uuid.uuid4() instead of the $sessionId variable in your powershell script.
I kept getting an error.
After that I created a simple ps1 file in windows with
$SessionId = [guid]::NewGuid()
and using this SessionId also gave an error.
Can someone explain what this script is doing with uuid generation?
When using with Powershell 7.1.0 the following error is shown:
.\Fido.ps1
Please Wait...
Add-Type: Fido.ps1:66
Line |
66 | Add-Type -MemberDefinition $code -Namespace Gui -UsingNamespace "Syst …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| (18,16): error CS1069: The type name 'Icon' could not be found in the namespace 'System.Drawing'. This
| type has been forwarded to assembly 'System.Drawing.Common, Version=0.0.0.0, Culture=neutral,
| PublicKeyToken=cc7b13ffcd2ddd51' Consider adding a reference to that assembly. public static Icon
| ExtractIcon(string file, int number, bool largeIcon) ^
No problems when using with Powershell 5.
When I select Windows 11, an error pops up: "Could not retrieve architectures from server"
Log from Rufus v.3.19.1911
Downloading https://github.com/pbatard/Fido/releases/download/v1.29/Fido.ps1.lzma
File length: 17.5 КБ
Successfully downloaded 'Fido.ps1.lzma'
Download signature is valid ✓
Script signature is valid ✓
Please Wait...
Querying https://www.microsoft.com/ru-RU/software-download/
Querying https://www.microsoft.com/ru-RU/api/controls/contentinclude/html?pageId=a8f8f489-4c7f-463a-9ca6-5cff94d8d041&host=www.microsoft.com&segments=software-download,windows11&query=&action=getskuinformationbyproductedition&sessionId=54890e05-5a86-4921-bd05-be982d695542&productEditionId=2069&sdVersion=2
Querying https://www.microsoft.com/ru-RU/api/controls/contentinclude/html?pageId=a224afab-2097-4dfa-a2ba-463eb191a285&host=www.microsoft.com&segments=software-download,windows11&query=&action=GetProductDownloadLinksBySku&sessionId=54890e05-5a86-4921-bd05-be982d695542&skuId=13228&language=Russian&sdVersion=2
Error: Could not retrieve architectures from server
The very last version of Fido can be ran by simply entering this command in PowerShell:
Invoke-Expression (Invoke-RestMethod https://github.com/pbatard/Fido/raw/master/Fido.ps1).SubString(3)
The reason I'm using .SubString(3)
is because of the encoding of Fido.ps1 which has a byte order mark, if the encoding gets changed to UTF-8 it shouldn't be needed
You can also pass arguments this way:
$Script = (Invoke-RestMethod https://github.com/pbatard/Fido/raw/master/Fido.ps1).SubString(3)
iex "& {$Script} -Win 10"
I using the script on linux, and for downloading i use official powershell for linux via docker/podman
The last version of script which I can succesfully run is 1.4.1, after that when I try to download any version of Windows i get following error:
PS /home/tokariew/tmp> ./Fido.ps1 -Win List
Error: This feature is not available for this version of Windows.
PS /home/tokariew/tmp> ./Fido.ps1 -Win 10
Error: This feature is not available for this version of Windows.
On 1.4.1 I can download Windows 10 iso without problem
Podman command which i run
podman run \
-it \
--privileged \
--rm \
--name powershell \
--net=host \
--volume $HOME:$HOME \
mcr.microsoft.com/powershell
Looks like my dev machine is now permabanned from downloading MS ISOs.
It looks like MS is applying some deep fingerprinting to detect requests from the same machine. Here's what works and doesn't work:
[FAILS]
Clearing IE's cache, including cookies and stuff[FAILS]
Changing IP address (works for temp ban but not permaban)[FAILS]
Changing MAC address[FAILS]
Changing User-Agent[FAILS]
Changing screen resolution[WORKS]
Using a VM using NAT from same IP[WORKS]
Using Firefox with Linux User-AgentI suspect the JS we execute from MS (which we need to get the session-id) does some very custom browser + env fingerprinting. We may have to take a closer look at it...
HI,
Great script, fantastic work.
I am trying to modify for use as an unatended script. I am curious on where you are initially sourcing the productEditionId from?
From what I can see this is the key information the script is based off, the Id's dont seem to match up with any other reference I found.
Thanks
Fido is a great script as it makes downloading legitimate Windows OS ISOs so much easier via PowerShell, however there is no way to verify the expected file is fully and accurately downloaded. It would be helpful if there was a way to get the expected hash (preferably SHA256 as this is what is provided on https://www.microsoft.com/en-us/software-download/windows10ISO) of the ISO so it can be compared against the actual hash after the file is downloaded to ensure the file was fully and correctly downloaded.
This issue can be demonstrated when the script is invoked from Rufus.
If you click Confirm and then click back to have Rufus in foreground, Fido will appear to be frozen as it waits for the prompt for cookies to be in the foreground to be able to kill it.
Is there anything we can do to kill background prompts in PS?
Is it possible to add a support for those versions to this script?
Can you please add the windows 10 20H2 update to your script?
In GUI mode you get an error Error: Failed to retrive architectures from server
Receiving an "Error: could not parse languages" in both the UI and through PoSH. Happening for Win 10 and Win 11.
Switch
type parameter is aleady has value of $false
by default.disableprogress
to noprogress
.$verbose
is common parameter for advanced functions. Defining explicit $verbose
will result in conflict if you may want to introduce [CmdletBinding()]
attribute later.function t {
[CmdletBinding()]
param (
[switch]$verbose
)
}
t -verbose
t : A parameter with the name 'Verbose' was defined multiple times for the command.
At line:10 char:1
+ t -verbose
+ ~
+ CategoryInfo : MetadataError: (:) [], MetadataException
+ FullyQualifiedErrorId : ParameterNameAlreadyExistsForCommand
Error:无法分析响应内容,因为 Internet Explorer引擎不可用,或者Internet Explore的首次启动配置不完整。请指定 Use BasicParsing参数,然后再试一次。
Hello, last version of Powershell for linux introduced an change, and now $winver is empty, causing Fido to end with error message
Error: This feature is not available for this version.
Workaround is simple : setting $winver = 11.0 when empty.
if ( ! $winver)
$winver = 11.0
}
I'm trying to use Fido by python
It works on the first and second try
But on the third attempt
C:\Users\MesterPerfect\Desktop>python example.py
Error: We are unable to complete your request at this time. Some users, entities and locations are banned from using this service. For this reason, leveraging anonymous or location hiding technologies when connecting to this service is not generally allowed. If you believe that you encountered this problem in error, please try again. If the problem persists you may contact Microsoft Support – Contact Us page for assistance. Refer to message code 715-123130 and 205d9517-d8ea-4f25-8406-29cf579554eb.
How can I avoid this problem?
I saw that Invoke-WebRequest is being used in this script, I would suggest using Start-BitsTransfer:
With Invoke-WebRequest, the file is buffered in the memory first, before it's written to the disk. A faster and better way is to use the Start-BitsTransfer cmdlet in PowerShell. This cmdlet allows you to queue files, set priority (useful for bandwidth limitation), can run in the background and download multiple files asynchronous. By default, the download jobs run in the foreground consuming the maximum bandwidth available. You can change this by setting the priority of the job:
It was really cumbersome to unpack the release script. Had to install a program just for that. I'd say most people have WinRAR installed and it does not support it.
Would be a lot easier if you used a more common compression algorithm. Why not just deflate?
Right now if you use an Azerbaijiani locale (az-AZ
) you will get a 404 after the first selection because https://www.microsoft.com/az-AZ/software-download/Windows10ISO does not exist.
The script should detect the 404 and switch to using en-US
when that happens.
It should also handle graceful redirections such as id-ID
being redirected to default browser locale.
Just checked the recent commit here 8cf4a27
I got the below error message for windows 10 (windows 11 download worked)
But I can download 10 from the MS page with my same IP address using the user agent trick on Firefox. So maybe a further workaround is required in fido.
Edit - Now I can't redownload 11 from anywhere with any trick, getting the error message same as above. So looks like they are only allowing 2-3 downloads.
Edit - Download worked with Cloudflare free VPN
Add the ability to download Windows Insider + Server vNext
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.