[dba-Tech] Powershel script help

Jim Lawrence accessd at shaw.ca
Fri Apr 25 15:39:12 CDT 2014


Hi John:

It seems the the variables have to be clearly pre-defined, in the powershell and just establishing a variable by applying a value type to the variable is not enough...actually that is a lot better the loosey-goosey methods used to define variables like in JavaScript or the old versions of command DOS.

Jim  

----- Original Message -----
From: "John Bartow" <jbartow at winhaven.net>
To: "Discussion of Hardware and Software issues" <dba-tech at databaseadvisors.com>
Sent: Friday, April 25, 2014 11:24:52 AM
Subject: Re: [dba-Tech] Powershel script help

I tried setting $remaining to an integer: 
$remaining = $xml.RegistrationConfig.DaysRemaining  -as [int]

But that didn't work. 

Paul's suggestion of setting the variable value to another variable defined
as integer worked out though: 
$remainingint = $remaining -as [int]

So either my syntax in the first attempt is incorrect or setting the
variable when pulling data from the xml field's data just doesn't work. I
sometimes, well most of the time, think in VB terms and PS isn't the same
animal.

John B

_______________________________________________
dba-Tech mailing list
dba-Tech at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-tech
Website: http://www.databaseadvisors.com


More information about the dba-Tech mailing list