- 0
powershell Powershell guidance
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Similar Content
-
Microsoft finally fixes one of the most annoying things about PowerShell on macOS
By Usama Jawad96,
- microsoft
- powershell
- (and 11 more)
- 7 replies
- 0 views
-
Microsoft explains extremely confusing Teams meeting recording policy
By Usama Jawad96,
- microsoft
- microsoft teams
- (and 11 more)
- 0 replies
- 0 views
-
DAEMON TOOLS supply chain attack ongoing since April, thousands affected
By Fiza Ali,
- daemon tools
- kaspersky
- (and 5 more)
- 7 replies
- 0 views
-
Microsoft is retiring a PowerShell installation method on Windows
By Usama Jawad96,
- microsoft
- powershell
- (and 9 more)
- 12 replies
- 0 views
-
After Windows 11, Microsoft addressing "key" issues on one of its most powerful native tools
By hellowalkman,
- microsoft
- powershell
- (and 2 more)
- 3 replies
- 0 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