Changing Project with powershell | Nutanix Community
Skip to main content
Hi guys,



I'm somewhat new to Nutanix and I was curious if there was a powershell command that will allow you to set the project for a VM.



Essentially I want to use scripts to deploy VM's and then when the VM is deployed move it into a project so we can track resources.



The deployment part of this is easy enough, but nothing in powershell seems to indicate it can even do this.



Is this something that can even be done? I really like the powershell integration, and I really like the SSP Prism Central and Projects. I'd really really like to be able to use both of these together.



Thanks
Hi @ITNINJA!



I am a big PowerShell fan myself and I can see how this option would help in streamlining VMs' deployment and assignment. I had a look at several resources:

I was not able to find any reference to projects in the first two options however there is projects option in Rest API v3.0



More on API versions Nutanix API versions – What are they and what does each one do?



Hope that helps.

Hello  @ITNINJA 

 @Alona answered the question beautifully. 

Just to add a new feature here of dev.nutanix.com API reference where you can generate code for the API requests. 
You can use the below-mentioned guide, select the generate code option after filling the required details(UUID of the entity in this scenario)  and select Powershell
https://www.nutanix.dev/reference/prism_central/v3/api/projects/putprojectsuuid 


With a little push in the right direction by Alona I was able to conjure something together.  Using a combination of Powershell and REST API.   

Thanks for the assist!


That's really nice to hear @ITNINJA 

Maybe you can write a post about how you wrote the scripts and help the community grow more?

 


@ITNINJA Glad I was able to help and that you made it work in the end!