- 0
powershell Powershell guidance
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
- 1 reply
- 0 views
-
Microsoft releases PowerShell 7.5 RC1, GA due in January
By zikalify,
- microsoft
- powershell 7.5 rc1
- (and 3 more)
- 2 replies
- 1 view
-
Get this 2024 Windows PowerShell Certification Bundle for only $14.97
By News Staff,
- neowin deals
- powershell
- (and 2 more)
- 0 replies
- 0 views
-
Mastering PowerShell Scripting, Fifth Edition (worth $35.99) free download
By News Staff,
- ebook offer
- sponsored
- (and 3 more)
- 0 replies
- 0 views
-
Linus Torvalds accepts Microsoft's Hyper-V upgrade so next gen Linux boots faster 1 2
By hellowalkman,
- 38 replies
- 2 views
-
Question
Skiver Veteran
I've been tasked with trying to produce some statistics and I'd like to try and automate it rather than running these scripts and manually combining the data. I will admit I'm a complete Powershell n00b so I barely know anything so this is probably some elementary crap but trying to find examples to guide me has confused the hell out of me.
In a nutshell, I want my script to connect to connect to both a Virtual Machine Manager instance AND a couple of Hyper-V hosts and then export specific VM information. I can do all of this individually but I cannot make it work as one script and ideally as mentioned I want the exported data pumped into a single CSV.
I know my problem is going to be because I'm writing this line by line as I would by running it manually and I need to build some sort of intelligence into it. I suspect I need to go down the whole "foreach" route but the few examples I've found I just could not get my head around how you structure each variable within the collection.
If someone can do this and it's simple enough it would be great to have notes so I can understand what each line is doing (I understand that is asking for a lot)
I suspect my next issue will be that some of the attributes are not going to be the same between SCVMM and Hyper-V but one problem at a time
Link to comment
https://www.neowin.net/forum/topic/1309540-powershell-guidance/Share on other sites
1 answer to this question
Recommended Posts