VMware Cloud Community
tdubb123
Expert
Expert

The operation for the entity "folder" failed

I am trying to move VMs to a folder but getting this error. any idea?

Screen Shot 2018-01-12 at 7.27.14 AM.png

0 Kudos
2 Replies
daphnissov
Immortal
Immortal

See duplicate post here.

0 Kudos
LucD
Leadership
Leadership

The reason of the error is as Chip gave, but you can easily script a check to avoid this error.

The Type property tells you what a folder can be used for

Get-Folder | Select Name,Type


And in your scripts you can build in a test, something like this for example

$tgtFolder = 'MyFolder'

$folder = Get-Folder -Name $tgtFolder

if($folder.Type -ne 'VM'){

    Write-Output "You can't move VMs in here!"

}


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos