Solved

parse string to int

Posted on 2014-12-02
1
93 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
ID: 40477266
You should be able to just substitute the following.
@{name = 'HighDepth'; expression ={[int32]$_."High Depth")}}

Open in new window

0

Featured Post

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

In this previous article (https://oddytee.wordpress.com/2016/05/05/provision-new-office-365-user-and-mailbox-from-exchange-hybrid-via-powershell/), we made basic license assignments to users in O365. When I say basic, the method is the simplest way …
Create and license users in Office 365 in bulk based on a CSV file. A step-by-step guide with PowerShell script examples.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

911 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

22 Experts available now in Live!

Get 1:1 Help Now