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

Reply To: Add Column to CSV

To make sure I understand the properly, you want to both add a new column to the CSV, and remove any rows for users that don’t have an email address defined? If so, try this: Import-Csv -Path test.csv...

View Article


Reply To: Compare file creation date with current date and send email

For sending an email, use the Send-MailMessage cmdlet (run Get-Help Send-MailMessage -Full to learn about its options). I’m not sure which file you want to send, but here’s a generic example for...

View Article


Error Calling Web Service Method

Hello all,I’m trying to work with a vendor-supplied web service. I’m able to consume it easily enough from C#, but I’m struggling from powershell.I’m by no means an expert with web services or the XML...

View Article

Reply To: Error Calling Web Service Method

My first question would have to be have you got the type correct for the parameters you are passing in?Do you have a call that works in C# that doesn’t in PowerShell?

View Article

Reply To: JavaScript problem with EnhancedHTML module

Yeah, the HTML looks fine… And yes, I see the same results in Chrome and IE. Still can’t get Firefox to run the javascript. Even copying/pasting into a static html file gives me the same results....

View Article


Image may be NSFW.
Clik here to view.

Reply To: Coding style (pipelines and script blocks)

I probably should have mentioned this in the original post, but I try to avoid the first approach you mentioned (saving the results of each command to a temporary variable, then using the foreach...

View Article

Reply To: JavaScript problem with EnhancedHTML module

So, when I tested, I removed the SCRIPT tags. It’s possible the browsers aren’t liking loading those from a local path like that. You might try that as a troubleshooting step. In FF and Safari, and in...

View Article

Reply To: JavaScript problem with EnhancedHTML module

Right. Forgot to mention that I had done that in Chrome, and forgot what the results looked like. For whatever reason, starting with row 3, it has both classes listed for <tr><tr class=”even...

View Article


Reply To: JavaScript problem with EnhancedHTML module

Well, that’s why the formatting is whack. But I’m not sure what would make the module do that. You’d have to troubleshoot the bit where it walks the table and applies the class. It’s almost like it’s...

View Article


Converting WMI Date and Time

I’m currently trying to convert a date and time value returned from a WMI query to something more readable. I can accomplish this easily when one object is returned using...

View Article

Reply To: JavaScript problem with EnhancedHTML module

So just to add to the fun…if I remove the “‘EvenRowCssClass’='even’;” and “‘OddRowCssClass’='odd’;” lines from the $params hash table assignment and re-create the html, I get table rows with no classes...

View Article

Reply To: JavaScript problem with EnhancedHTML module

And I don’t guess I ever mentioned it, but I really like the module and the ebook! This is my first time to use it, (obviously), and it’s so much easier to use the module you created than to try and...

View Article

Reply To: Converting WMI Date and Time

You’ll have to loop them, but all WMI objects in PowerShell have a helper method, so you don’t necessarily need to use that class. Assuming $var contains a property MyDate:foreach ($thing in $var) {...

View Article


Reply To: Converting WMI Date and Time

It would help to see your starting code. Also, are you just trying to output the dates and times to the screen, or do you want to save the converted values in an object for later use?Here’s a simple...

View Article

Reply To: JavaScript problem with EnhancedHTML module

So, I should point out that the dynamic datatable thing does its own coloring. That might be what you’re running into. And I think it might use class names odd/even to do so.

View Article


Image may be NSFW.
Clik here to view.

Reply To: Converting WMI Date and Time

@Don, I have v3, but the endpoints that I’m running this script against will most likely have v2. Can I still use CIM?When I try running your example, it complains that it does not have a...

View Article

SQLPS install

What is the easiest way to install SQLPS module? We plan to use invoke-sqlcmd on more than 2000+ servers. (Windows server 2003 standard edition/ SQL Server 2008 EXPRESS SP2).I know SQLPS comes with SQL...

View Article


Reply To: SQLPS install

SQLPS first shipped with SQL2008R2, in fact. But I’m not sure the module will work with older versions of SQL Server – there was server-side programming that had to be done in order to make the module...

View Article

Reply To: Converting WMI Date and Time

If the end points are v2 you can still use the CIM cmdlets but you have to create a DCOM based CIMsession to the endpointif you are staying with wmi cmdlets looks like your code will be something...

View Article

Reply To: SQLPS install

Thank you Don.I found this post on installing SQLPS without installing SQL Server. http://blog.smu.edu/wis/2012/11/26/sql-server-powershell-module-sqlps/But as you said, I’m not sure if I can use...

View Article
Browsing all 13067 articles
Browse latest View live