PoshCode Archive  Artifact Content

Artifact 059ad3313d61d634899e7b157768c07f57fb67cf56a8a38d3ba565c1b100416a:

  • File Step03b-Move-datastore-t.ps1 — part of check-in [dd46a11b1f] at 2018-06-10 13:58:52 on branch trunk — Script to create Datastore clusters and add datastores from csv (user: Leon Scheltema size: 913)

# encoding: ascii
# api: powershell
# title: Step03b-Move-datastore-t
# description: Script to create Datastore clusters and add datastores from csv
# version: 0.1
# type: script
# author: Leon Scheltema
# license: CC0
# x-poshcode-id: 5667
# x-archived: 2015-01-15T20:03:30
# x-published: 2015-01-07T13:39:00
#
#
# Script to create Datastore clusters and add datastores from csv
# By Leon Scheltema AVANCE ICT Groep Nederland

# Begin variables
$VC1 = "New vCenter"
$DSCluster = "Datastore Cluster"
# End variables

# Connect to vCenter server
Connect-VIServer "$VC1"

Set-DatastoreCluster -DatastoreCluster $DSCluster -SdrsAutomationLevel FullyAutomated

Import-CSV $DSCluster.csv | ForEach-Object {

	$Datastore = $_.Name

move-datastore -Datastore $Datastore -Destination $DSCluster

# Disconnect from vCenter server
Disconnect-VIServer -server "$VC1" -Force -Confirm:$false