Quantcast
Channel: PowerShell.org » All Posts
Browsing all 13067 articles
Browse latest View live

Reply To: Wildcards in switch strings

Yes that is what I mean. Thanks for all the hints. I'll try it.

View Article


Reply To: Get-unique items from an array

Get-Unique compares each item in a list with the next item in the list and will only work against sorted lists. If you want to user Get-Unique you have to sort the list first: $a | Sort-Object...

View Article


Reply To: Get-unique items from an array

Hi Simon, I have tried both approaches and they both yield the same results. Also I am already sorting the array am I not $a | Sort-Object id | Get-Unique . Do you think that I need to sort the...

View Article

Reply To: Event log script help.

First, you set the variable $Date to "24 hours before now" : $Date = [DateTime]::Now.AddHours(-24) Then, you set the same variable $Date to another value which means "right now" $Date = get-date...

View Article

Image may be NSFW.
Clik here to view.

Invoke-Command Credential Pop Up

For the life of me, I can't figure out why one specific Invoke-Command one liner is prompting me for credentials on a server I have admin rights to. For example: Invoke-command -Session $connect10...

View Article


Reply To: Get-unique items from an array

You are right, Select-Object -Unique and Get-Unique seems to both select unique entries based on ProcessName. To select unique entries based on only Id you could use this: $a | Sort-Object -Property...

View Article

Reply To: Invoke-Command Credential Pop Up

Update: FWIW, it also does it if I manually Enter-PSSession to that $connect10 machine and run the Connect-VIServer cmdlet…

View Article

Reply To: Get-unique items from an array

Try Sort-Object -Unique since it lets you indicate the property that you want to sort\be unique: $process = Get-Process $cpu = $process | Sort-Object CPU -Descending | Select-Object -First 5 $ws =...

View Article


Reply To: Get-unique items from an array

Thank you both Simon and Rob, Both solutions worked for me. Simon I cant believe that I didn't try: $a | Select-Object 'Handles', 'NPM', 'PM', 'WS', 'VM', 'CPU', 'Id', 'ProcessName' -Unique I had...

View Article


Reply To: Invoke-Command Credential Pop Up

It's hard to tell without seeing the exact error / popup message you're getting, but it looks like you're probably running into the "second hop" scenario of Remoting. You're connecting to some...

View Article

Reply To: looking for guidance regarding html reporting

$computers = @(Get-Content "C:\scripts\class-lists\test-lab-computers.txt") $ChromeOutcome = @() foreach ($computer in $computers) { $test_file = (get-item -ErrorAction SilentlyContinue...

View Article

Reply To: Event log script help.

Hi Mathieu, Thanks for your reply. I had noticed the 2 variables that were the same, but as the script had been working I decided not to mess with it. I've changed the variables and I'm currently...

View Article

AD User Importing Script Adjustments

Hello All, and thanks if advance for any help. I am working on this script to import users and need some help to figure out the remaining hurdles. I will take one hurdle at a time. In the script I am...

View Article


Need PowerShell Training for Atlanta PS Newbies

Good Day, Do you have any recommendations for an 'in classroom' PowerShell training course in Atlanta? My team and I need PowerShell training and have been having a hard time finding the right...

View Article

Reply To: Need PowerShell Training for Atlanta PS Newbies

I don't know what you're looking for in terms of schedule and pricing, but you can get information about Don Jones' class at http://www.concentratedtech.com/education .

View Article


Reply To: Need PowerShell Training for Atlanta PS Newbies

Jason Helmick is actually covering our ConTech classes right now; you're welcome to contact him (it's JasonH at our domain name). He's available for private on-site classes; we don't maintain a public...

View Article

Reply To: Event log script help.

Thanks to the parameters -After and -Before of the cmdlet Get-EventLog, it's not difficult. Define the variables that you are going to feed to -After and -Before : [datetime]$StartDate = "06/01/2014"...

View Article


Powershell network drive Get-ChildItem issues

Essentially I'm trying to use PowerShell to find files with certain file extensions on a network drive created on or after June 1st of this year. I thought I could do that with the following...

View Article

Reply To: AD User Importing Script Adjustments

Sean, PowerShell won't resolve %username% for you but you can use the SamAccountName property if you add the HomeDirectory property after the Hashtable has been defined. Example: $hash = @{ Name =...

View Article

EnhancedHTML2

Where can I download the EnhancedHTML2 module? I downloaded the ebook Creating HTML Reports in PowerShell. The book says that it comes with it but it does not…. I have tried searching using...

View Article
Browsing all 13067 articles
Browse latest View live