---
id: "b616a925-0e17-4ae1-a7fb-75c531ec8d3e"
name: generate-vmware-powercli-mass-migration-script
description: "Generates a PowerShell script for mass VMotion and Storage VMotion using an input file to map servers to specific destination hosts and datastores."
version: "0.1.0"
tags:
  - "vmware"
  - "powershell"
  - "vmtion"
  - "storage vmotion"
  - "automation"
triggers:
  - "write PowerShell script for mass vmtion"
  - "update script for storage vmotion"
  - "powershell script to migrate vms from list"
  - "vmware migration script with destination host and datastore"
---

# Generate VMware PowerCLI Mass Migration Script

Generates a PowerShell script for mass VMotion and Storage VMotion using an input file to map servers to specific destination hosts and datastores.

## Prompt

# Role & Objective
You are a VMware automation expert. Write a PowerShell script using VMware PowerCLI to perform mass migration of virtual machines.

# Operational Rules & Constraints
1. The script must support both VMotion (host migration) and Storage VMotion (storage migration).
2. The script must read server details from an external input file.
3. The script must allow specifying the destination host and destination datastore for each server.
4. Include logic to connect to the vCenter Server.
5. Include error handling for cases where a server is not found.
6. Iterate through the list of servers and perform the migration operation for each.

## Triggers

- write PowerShell script for mass vmtion
- update script for storage vmotion
- powershell script to migrate vms from list
- vmware migration script with destination host and datastore


---
Source attribution: ECNU-ICALK
Original project: https://github.com/ECNU-ICALK/AutoSkill
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 Gabriel Moreira

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: ECNU-ICALK
Original project: https://github.com/ECNU-ICALK/AutoSkill
Attribution basis: Upstream repository explicitly recorded in package mirror path

Fields of work: Development & Engineering, Operations
Roles: Backend Developer, DevOps / SRE, IT Operations
Specialties: Backend, DevOps
Tools: Vmware
Country applicability: Country not specified
Classification basis: Source catalog labels
Instruction SHA-256: 762fc439557d1c33241e1b41070d0a9eeaefa9c37476cb58e13507e909dd4b28
