For VMs in the Same Folder

Get-Folder "Server" | Get-VM | Sort Name | FT -AutosizeGet-Folder "Server" | Get-VM | Set-Annotation -CustomAttribute "Department" -Value "IT"Get-Folder "Server" | Get-VM | Set-Annotation -CustomAttribute "Owner" -Value "Richard"Get-Folder "Server" | Get-VM | Set-Annotation -CustomAttribute "Requester" -Value "Amy"

For VM Name with the Same Prefix

Get-VM "FAMSC*" | Sort Name | Select Name, PowerState, NumCpu, MemoryGB, VMHost, Folder | FT -AutosizeGet-VM "FAMSC*" | Set-Annotation -CustomAttribute "Department" -Value "IT"Get-VM "FAMSC*" | Set-Annotation -CustomAttribute "Owner" -Value "Richard"Get-VM "FAMSC*" | Set-Annotation -CustomAttribute "Requester" -Value "Amy"

For single VM

Get-VM "FAMSCAD01" | Set-Annotation -CustomAttribute "Department" -Value "IT"Get-VM "FAMSCAD01" | Set-Annotation -CustomAttribute "Owner" -Value "Richard"Get-VM "FAMSCAD01" | Set-Annotation -CustomAttribute "Requester" -Value "Amy"
©著作权归作者所有:来自51CTO博客作者520feng2007的原创作品,如需转载,请注明出处,否则将追究法律责任

好知识,才能预见未来

赞赏

0人进行了赞赏支持

更多相关文章

  1. centos7 系统自带的OpenJDK切换成的Oracle JDK版本(以JDK1.8为例)
  2. 同用户不能同时打开Google Chrome谷歌浏览器
  3. CodeHub#4 前情预告|H5 容器在技术实践中的应用
  4. JavaScript 将字符串转换为对象
  5. ack 挂载nas-pvc报错 mount: wrong fs type bad option
  6. ORA-27154: post/wait create failed
  7. 对linux配置文件的处理----grep&sed
  8. MySQL5.6 myisam表修复
  9. 超级简单的应用虚拟化软件 [RemoteApp Tool]

随机推荐

  1. C#中操作Oracle时的SQL语句参数的用法
  2. 装了sql server 2005附加数据库成功,程序
  3. 如何将“u00e9”转换为一个utf8字符,在mys
  4. MYSQL从同一个表中选择标记关联的id
  5. 【整理】更改MSSQL默认字符集
  6. MySQL(三)——数据行 操作
  7. 求sql【复制同一表记录,但有两个字段需要
  8. [Python] - No.1 使用python3连接Mysql
  9. 从另一个表中的列更新列值
  10. 减去两个SELECT语句以产生单个结果?