Solved

parse string to int

Posted on 2014-12-02
1
91 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 39

Accepted Solution

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

Open in new window

0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Synchronize a new Active Directory domain with an existing Office 365 tenant
This article will help you understand what HashTables are and how to use them in PowerShell.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now