如需在 Windows 计算机上使用命令提示符和 curl 下载最新版本的 mcdc CLI,请执行以下操作:
for /f usebackq %V in (`curl -s https://mcdc-release.storage.googleapis.com/latest`) do curl -O https://mcdc-release.storage.googleapis.com/%V/windows/mcdc.exe
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-11。"],[],[],null,["# Download Migration Center discovery client CLI\n\nTo discover your assets, you need to download the Migration Center discovery client CLI to a\nmachine that has access to all your target assets. The machine can\nbe a physical server or a virtual machine (VM) instance.\nThe `mcdc` CLI executable is available in two versions,\nLinux and Windows,\ndepending on the OS of the machine where you want to install it.\n\nThe `mcdc` CLI performs the guest discovery by running\ncollection scripts remotely on your target machines from the machine where\nit is installed. It can also find and collect data from multiple machines\nusing the IP range scan.\nYou can run a guest discovery on VMs running on VMware, and on machines\nwith a connection to the machine hosting the `mcdc` CLI.\n\nAlternatively, to perform a discovery on VMs hosted on AWS and Azure,\nor on your on-premises machines without SSH access, you need to download\nthe guest collection script and run it locally.\nUse `mcdc-linux-collect.sh` on Linux machines and `mcdc-windows-collect.ps1`\non Windows machines.\n| **Note:** In environments where you have hundreds or thousands of VMs, you might already have tools to automate the process of downloading and running the guest collection script on each VM.\n\nThis document describes how to download the `mcdc` CLI\nand the collection scripts to discover and collect your infrastructure data.\n\nBefore you begin\n----------------\n\n- [Review the requirements for downloading the `mcdc` CLI](/migration-center/docs/review-collector-cli-requirements)\n\nDownload `mcdc` CLI\n-------------------\n\nDepending on the OS of the machine, download the Linux or Windows executable\nof the `mcdc` CLI. \n\n### Linux\n\n- Download the latest version of the `mcdc` CLI on a Linux machine and make it executable:\n\n curl -O \"https://mcdc-release.storage.googleapis.com/$(curl -s https://mcdc-release.storage.googleapis.com/latest)/mcdc\"\n chmod +x mcdc\n\n### Windows\n\n- To download the latest version of the `mcdc` CLI on a Windows machine with Powershell and `Invoke-WebRequest`:\n\n $ProgressPreference = 'SilentlyContinue'; $version = Invoke-RestMethod -Uri 'https://mcdc-release.storage.googleapis.com/latest'; Invoke-WebRequest -Uri \"https://storage.googleapis.com/mcdc-release/$($version.Trim())/windows/mcdc.exe\" -OutFile mcdc.exe\n\n- To download the latest version of the `mcdc` CLI on a Windows machine with Command Prompt and `curl`:\n\n for /f usebackq %V in (`curl -s https://mcdc-release.storage.googleapis.com/latest`) do curl -O https://mcdc-release.storage.googleapis.com/%V/windows/mcdc.exe\n\n- To download the latest version of the `mcdc` CLI with a direct link:\n\n https://mcdc-release.storage.googleapis.com/current/windows/mcdc.exe\n\nView help information for `mcdc` CLI\n------------------------------------\n\n- To view help information for the `mcdc` CLI, use the\n `--help` flag:\n\n\n ### Linux\n\n \u003cbr /\u003e\n\n ```\n ./mcdc --help\n ```\n\n \u003cbr /\u003e\n\n ### Windows\n\n \u003cbr /\u003e\n\n ```\n mcdc.exe --help\n ```\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\n- To view help for a specific command, use the `--help` flag with the command.\n For example, to view help for the `import` command, run the following command:\n\n\n ### Linux\n\n \u003cbr /\u003e\n\n ```\n ./mcdc discover import --help\n ```\n\n \u003cbr /\u003e\n\n ### Windows\n\n \u003cbr /\u003e\n\n ```\n mcdc.exe discover import --help\n ```\n\n \u003cbr /\u003e\n\n \u003cbr /\u003e\n\nDownload guest collection scripts\n---------------------------------\n\nTo download the guest collection scripts on the target machine, perform the\nsteps in the following sections.\n\n### Download guest collection script on a Linux machine\n\nOn a Linux machine, to download `mcdc-linux-collect.sh`, follow these steps:\n\n1. Log in to the machine.\n\n | **Note:** To generate optimal assessment results, it is recommended that for running a guest discovery, you log in with a user that has administrator rights.\n2. Download the guest collection script to the machine and make it executable:\n\n curl -O \"https://mcdc-release.storage.googleapis.com/$(curl -s https://mcdc-release.storage.googleapis.com/latest)/mcdc-linux-collect.sh\"\n chmod +x mcdc-linux-collect.sh\n\n### Download guest collection script on a Windows machine\n\nOn a Windows machine, to download `mcdc-windows-collect.ps1`, follow these steps:\n\n1. Log in to your machine and open PowerShell.\n\n | **Note:** To generate optimal assessment results, it is recommended that for running a guest discovery, you log in with a user that has administrator rights.\n2. Download the guest collection script to the machine:\n\n $version = Invoke-WebRequest -UseBasicParsing https://mcdc-release.storage.googleapis.com/latest\n $WebClient = New-Object System.Net.WebClient\n $WebClient.DownloadFile(\"https://mcdc-release.storage.googleapis.com/\"+$version+\"/mcdc-windows-collect.ps1\", (Get-Location).Path + \"\\mcdc-windows-collect.ps1\")\n\nWhat's next\n-----------\n\n- Learn how to discover assets using the following methods:\n\n - [Inventory discovery](/migration-center/docs/run-inventory-discovery)\n - [Guest discovery](/migration-center/docs/run-guest-discovery)\n - [IP range scan](/migration-center/docs/run-ip-range-scan)"]]