Solved

parse string to int

Posted on 2014-12-02
1
95 Views
Last Modified: 2014-12-03
Hello EE,

I have an object , one of the members is a string ( high depth), I wish to convert those to int. Not sure on the structure to do this . Using the below statement from a select statement ? below gives;

Cannot convert argument "style", with value: "System.Object[]", for "Parse" to type "System.Globalization.NumberStyles

$activity | select object` name, @{ name = 'date' ; expression = { [datetime]::ParseExact($_.date,"yyyy-MM-dd HH:mm:ss",$null)}},put,got,high` depth,queue` mgr,type, @{name = 'HighDepth'; expression ={[int32]::Parse($a,$activity."High Depth")}}

Open in new window

0
Comment
Question by:davesnb
1 Comment
 
LVL 40

Accepted Solution

by:
footech earned 500 total points
ID: 40477266
You should be able to just substitute the following.
@{name = 'HighDepth'; expression ={[int32]$_."High Depth")}}

Open in new window

0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Set OWA language and time zone in Exchange for individuals, all users or per database.
A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question