Solved

parse string to int

Posted on 2014-12-02
1
99 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Windows 10 came with  a lot of built in applications, Some organisations leave them there, some will control them using GPO's. This Article is useful for those who do not want to have any applications in their image (example:me).
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

696 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