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

Image may be NSFW.
Clik here to view.

Reply To: string manipulation

hi, If you love to hate regex (sorry Dave), this also works: $name = $text -split [environment]::NewLine | foreach { if($_.startswith("Name")){$_.split(":")[1]} } $name or $name = $text -split "`n" |...

View Article


Reply To: Schedule rolling reboots with service check & email?

hi, you can start with this? $servers = @("server1","server2") $Body = "server was rebooted at" $mailParam = @{ To = "Dude@contoso.com" Subject = "Server rebooted" From = "noreply@contoso.com"...

View Article


Image may be NSFW.
Clik here to view.

Reply To: string manipulation

I can’t help it. I learned regular expressions at a formative age, and now they’re like my coding security blanket.

View Article

Reply To: Review Request- How 2 Simplify

Hi Tore, Thank you very much for taking the time to respond. I’m somewhat new to powershell & am also not accustomed to ‘best practices’ when posting examples. I’ll do better with the non-alias...

View Article

Select-Object to use property and expand property

Hi, I have a small issue, how to use both property and expand property at the same time. Though they are in same parameter set, i am unable to use it. Select-Object [[-Property] <Object[]>]...

View Article


Reply To: Select-Object to use property and expand property

I can reproduce this in PowerShell 2.0, but in 4.0 it works fine. Not sure about 3.0; I don’t have a system handy that hasn’t been upgraded to 4.0 right now.

View Article

Reply To: Running get-childitem on remote server to check file versions

I got it working. Thanks everyone for the help. I changed things up and now have everything outputting to a file. Thank you for your suggestion. It does work rather nicely. Here is the file code of...

View Article

Reply To: PowerShell DSC: Composite Configurations / Node GUID Management

I think we’re probably a little early on for real practices to have emerged. I think, in the long view, we need to view DSC as a platform technology – not as tooling. We do need tooling around it. I...

View Article


Deploy powershell 5? Group policy?

What would be the easiest way to deploy Pshell 5? I am very interested in using the install-package functionality. Can you configure machines to get this through windows update?

View Article


Reply To: Deploy powershell 5? Group policy?

PowerShell 5 is ABSOLUTELY BETA code and is NOT intended for deployment at this time. How you install it now is very different from how you install it when it’s finally released. I don’t think we...

View Article

TEST

TEST

View Article

SECOND TEST

These tests are related to a change in the mailing list we use to distribute new-post notifications. You may see notices coming from @listbox.com if we make the transition.

View Article

Filtering based on calculated properties

Hi guys, I have a new problem, where I got stuck: I am generating a huge csv report, where I would like to remove a lot of rows. But there are so many, that Excel can’t handle them. So, I thought I...

View Article


Reply To: Filtering based on calculated properties

Sure, you can, but you may find that you get better performance with filtering first, then adding the calculated property. Either of these should work: dir C:\ -recurse | Where-Object { $_.Length -gt...

View Article

Problems reading in from array

Hi, I’m having some issue with following script: $Computers = get-adcomputer -filter * -searchbase "ou=computers,dc=domain,dc=com" | foreach-object {$_.name} foreach ($computer in $Computers)...

View Article


Reply To: Problems reading in from array

Your ForEach-Object is a bit of an odd way to do what you’re after… Get-ADComputer -filter * | Select -Expand Name Is a bit more common. The errors are coming from inside your Get-WindowsKey function....

View Article

Reply To: Problems reading in from array

Hey Don, thank you for your response. I’ll make that amendment to the script, thanks for the suggestion. I noticed as soon as I posted that the error looked to be stemming from the function itself....

View Article


Reply To: Problems reading in from array

Looks like all you really need is some error handling. If the ([WMIClass]“\\$target\root\default:stdRegProv”) expression throws an error such as RPC Server is Unavailable, there’s really no point in...

View Article

Reply To: Logging an Event into Windows Event Logs

Hi All Im still struggling with this issue, appreciate any help if you have the time. Thanks Francis

View Article

Bug in PS V4 ping > ctrl + pause > ctrl+c closes

Hi all. Actually I’m learning powershell in mva. I’m finishing basic powershell V3.0 and advanced scripting courses. I have powershell V4 installed in my two machines (personal and job computers). One...

View Article
Browsing all 13067 articles
Browse latest View live