You are not logged in.

#1 14 Aug 2008 20:46

Fen_Li
Member
From: Malang, Indonesia
Registered: 04 May 2007
Posts: 22
Website

Similar Command

can anyone tell me what is similar command for :

@echo off
REM
%variable%

in powershell 1.0 ??

and, is powershell support operator like "|","&","&&", math operation (+,-,/,*) ?

thanks b4..


G-Smart thing Smart

Offline

#2 15 Aug 2008 00:15

Simon Sheppard
Admin
Registered: 27 Aug 2005
Posts: 1,130
Website

Re: Similar Command

You don't really need @echo off in powershell as the defaults are pretty sensible, but if you need to, most commands support -OutVariable and -Verbose Common parameters

REM
Use #

%variable%
Use $
e.g.
PS C:\>$_myvar = "test123"
PS C:\>"$_myvar"

You also have the longer syntax of Set-Variable and Get-Variable, these give you access to additional object properties, for example you can assign a Description to the variable.
And yes powershell supports all the operators you could ask for, when I get time I will add some Syntax pages for this stuff.

Offline

Board footer

Powered by