Reply To: Formating output
Thanks Rob , that was the ticket. appreciate yours and Dave's responses. It is very evident that he has a wealth of knowledge, just a shame that he makes it such a volatile environment when people are...
View ArticleReply To: Formating output
You could always do a Magic! parity on Rude… ♪ Why you gotta be so rude I'm just not as technical dudeee Why you gotta be sooo ruudddee… Post that thread Post it anyway Post that thread Post it anyway...
View ArticleReply To: Formating output
From now on this is were I will be hanging out Great environment.
View ArticleWhere are the default powershell environment variables physically stored?
I am new to powershell, I have a background in k-shell/bash. Where are the default profile/environment variables physically stored? In bash everything is stored in .profile and there is no need to...
View ArticleReply To: Where are the default powershell environment variables physically...
There are a few different concepts in play here: Environment Variables, such as PSModulePath, have a few different "scopes" (for lack of a better term). There are System environment variables that...
View ArticleScript to query perfmon (.blg) files
I have written a basic script to query the daily performance logs on an Exchange 2013 server. Download below from TechNet gallery http://gallery.technet.microsoft.com/Get-EDSData-46088d49#content It...
View ArticleReply To: Script to query perfmon (.blg) files
It looks lke Import-Counter also has a -ListSet parameter. Your script could run that command against the blg files, then compare your $Counter parameter (using wildcards to the list) before running...
View ArticleProblem with events when useing Start-job and WPF
Hello, I have been trying to get "start-job" to work with WPF and events, but all it dose is crashing when the event is fired. I am guessing that it has something to do with the run-spaces, but cant...
View ArticleReply To: Handling errors
Hi, I'm reading the material you indicated to me =] [EDITED] oh….. just forget about it… "immediately" means right before the cmdlet you want to check… it's not about time =/ sorry… lost me in...
View ArticleReply To: Where are the default powershell environment variables physically...
After taking your lead and some further research, it seems that powershell is getting these default values out of the registry, as I suspected: HKEY_CURRENT_USER\Volatile Environment for User...
View ArticleReply To: Handling errors
$? is *really* a poor way to do error handling. You should instead use -ErrorAction and a Try/Catch block. Within the Catch block, you can check $_ or $error[0] to see the error that happened.
View ArticleAdding Variable to Hash Table.
How would I add $hashAdmin to Hash Table? PS C:\Windows\system32> $hashadmin.gettype() IsPublic IsSerial Name BaseType ——– ——– —- ——– True True String[] System.Array PS C:\Windows\system32>...
View ArticleReply To: Adding Variable to Hash Table.
$hashAdmin is apparently an array, not a hashtable, according to your output. What are you trying to do with it?
View ArticleReply To: Adding Variable to Hash Table.
$ht = @{} $ht.SomeArray = $hashadmin You can add it just like any other element just as long as you assign it a key.
View ArticleReply To: Adding Variable to Hash Table.
Would like to convert that variable to a object. I figured since it already in the correct hashtable format there should be a way to just add it. $obj= New-object PSobject -property $hashadmin But I...
View ArticleReply To: Adding Variable to Hash Table.
I see. As luck would have it, your strings are in a format which makes it possible to use the ConvertFrom-StringData cmdlet (which will give you your hashtable): $stringArray = [string[]]@(...
View ArticleReply To: Adding Variable to Hash Table.
Below is the code so far. I would like to add the value of the $hashAdmin to a PSobject. Because the array is already in the correct key = value format . Simple said I want to convert it from an array...
View ArticleReply To: Adding Variable to Hash Table.
That worked perfectly. output Domain Name —— —- "SecretComputername" "SecretUser" "almosttheweekend" "Domain Admins" $adminMember= Get-wmiobject win32_groupuser | where {$_.groupcomponent –like...
View ArticleReply To: Adding Variable to Hash Table.
You can get that same information quite a bit more easily, if you like (without resorting to string parsing steps): $group = Get-WmiObject Win32_Group -Filter 'Name = "Administrators"'...
View ArticlePowershell – group members & attribs for multiple groups report?
Hello, I am trying to find a way to export the members of specific groups that I have display names of in a list. I need user attributes such as display name, email address, description, account...
View Article