Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > PowerShell

Vista - same beginners questions

Reply
 
Old 09-28-2007   #1 (permalink)
HassanMullah


 
 

same beginners questions

hello,

i just begin with learning ms powershell. no i'm first by reading the
whitepapers. but now i have i few questions.

1.) can i use ms powershell also with .net 3.0 or only with .net 2.0
2.) how do i start ms powershell outside the powershell - i mean how
do you start "ps-batch" script from a cmd.exe ?
3.) need i a englisch ms powershell for english OS, and a german ms
powershell for german OS, or is that not important what language i
have ?
4.) can i use ms powershell on my computer, to control other computers
in the network, which have .net 2.0 / 3.0 but no the ms powershell
installed ?

kind regards

Hassan


My System SpecsSystem Spec
Old 09-28-2007   #2 (permalink)
RichS


 
 

RE: same beginners questions

To answer your questions in order:

1) PowerShell uses .NET 2.0 .NET 2.0 must be installed before PowerShell
can be installed. You may be able to use functionality from .NET 3.0
depending on what it is and loading the assembly into PowerShell

2) if you want to run a powershell script from the cmd prompt then you use

powershell.exe -Command "path to script"

you can see the full syntax by using powershell /?

3) You can download PowerShell from here
http://www.microsoft.com/windowsserv.../download.mspx
There are versions available in languages other than English. I would use
the appropriate language for your machine.

4) PowerShell cannot control other computers directly at the moment. You
can use WMI and .NET functionality to control remote machines. There are
some remoting add ons available for PowerShell
--
Richard Siddaway
Please note that all scripts are supplied "as is" and with no warranty
Blog: http://richardsiddaway.spaces.live.com/
PowerShell User Group: http://www.get-psuguk.org.uk


"HassanMullah" wrote:
Quote:

> hello,
>
> i just begin with learning ms powershell. no i'm first by reading the
> whitepapers. but now i have i few questions.
>
> 1.) can i use ms powershell also with .net 3.0 or only with .net 2.0
> 2.) how do i start ms powershell outside the powershell - i mean how
> do you start "ps-batch" script from a cmd.exe ?
> 3.) need i a englisch ms powershell for english OS, and a german ms
> powershell for german OS, or is that not important what language i
> have ?
> 4.) can i use ms powershell on my computer, to control other computers
> in the network, which have .net 2.0 / 3.0 but no the ms powershell
> installed ?
>
> kind regards
>
> Hassan
>
>
My System SpecsSystem Spec
Old 09-28-2007   #3 (permalink)
Marco Shaw


 
 

Re: same beginners questions

HassanMullah wrote:
Quote:

> hello,
>
> i just begin with learning ms powershell. no i'm first by reading the
> whitepapers. but now i have i few questions.
Welcome!
Quote:

>
> 1.) can i use ms powershell also with .net 3.0 or only with .net 2.0
You can use it with 2.0+. Installing a higher version, will still
install older versions of the framework. For example, 3.0 only contains
a limited number of updates, while 2.0 gives you the entire "base".
Quote:

> 2.) how do i start ms powershell outside the powershell - i mean how
> do you start "ps-batch" script from a cmd.exe ?
From DOS, type for information:
C:\>powershell /?

Quote:

> 3.) need i a englisch ms powershell for english OS, and a german ms
> powershell for german OS, or is that not important what language i
> have ?
Yes, get the proper package for your OS.
Quote:

> 4.) can i use ms powershell on my computer, to control other computers
> in the network, which have .net 2.0 / 3.0 but no the ms powershell
> installed ?
Yes, you can remotely "manage" other computers with other technologies
like WMI and ADSI. You call these from your PowerShell installation.

Marco


--
----------------
PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Old 09-28-2007   #4 (permalink)
Marco Shaw


 
 

Re: same beginners questions

Quote:

> 4) PowerShell cannot control other computers directly at the moment. You
> can use WMI and .NET functionality to control remote machines. There are
> some remoting add ons available for PowerShell
But they still require that PowerShell be installed on the remote machine.

Marco

--
----------------
PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Old 09-28-2007   #5 (permalink)
Hal Rottenberg


 
 

Re: same beginners questions

Marco Shaw wrote:
Quote:

> You can use it with 2.0+. Installing a higher version, will still
> install older versions of the framework. For example, 3.0 only contains
> a limited number of updates, while 2.0 gives you the entire "base".
Sorry to nitpick Marco but while your second sentence is true, the first is not,
at least not for pre-2.0 versions. You still have to install 1.0, 1.1, 2.0,
individually, independent of the order in which you install them. I have
installed .NET many, many, many times and ran into this.

--

Hal Rottenberg
Blog: http://halr9000.com
Webmaster, Psi (http://psi-im.org)
Co-host, PowerScripting Podcast (http://powerscripting.net)
My System SpecsSystem Spec
Old 09-28-2007   #6 (permalink)
Gerd Schneider


 
 

RE: same beginners questions

Regarding your question #3 I have to disagree with Rich & Marco. I live in
Germany and work for a global company, so I have the pleasure to enjoy
localization hell since the early days of Windows. PowerShell is an
administrative automation tool, it's not targeting on office users. Running a
corporate environment requires that your administrative tools behave in a
uniform manner everywhere, regardless of the local end user's language
preference, so our experience is to better stay away from localization
(whenever possible, but at least for administrative tools).

Gerd



"HassanMullah" wrote:
Quote:

> hello,
>
> i just begin with learning ms powershell. no i'm first by reading the
> whitepapers. but now i have i few questions.
>
> 1.) can i use ms powershell also with .net 3.0 or only with .net 2.0
> 2.) how do i start ms powershell outside the powershell - i mean how
> do you start "ps-batch" script from a cmd.exe ?
> 3.) need i a englisch ms powershell for english OS, and a german ms
> powershell for german OS, or is that not important what language i
> have ?
> 4.) can i use ms powershell on my computer, to control other computers
> in the network, which have .net 2.0 / 3.0 but no the ms powershell
> installed ?
>
> kind regards
>
> Hassan
>
>
My System SpecsSystem Spec
Old 09-28-2007   #7 (permalink)
Marco Shaw


 
 

Re: same beginners questions

Hal Rottenberg wrote:
Quote:

> Marco Shaw wrote:
Quote:

>> You can use it with 2.0+. Installing a higher version, will still
>> install older versions of the framework. For example, 3.0 only
>> contains a limited number of updates, while 2.0 gives you the entire
>> "base".
>
> Sorry to nitpick Marco but while your second sentence is true, the first
> is not, at least not for pre-2.0 versions. You still have to install
> 1.0, 1.1, 2.0, individually, independent of the order in which you
> install them. I have installed .NET many, many, many times and ran into
> this.
>
Nitpick away... Perhaps my memory is failing me though. Anything is
possible.

Marco


--
----------------
PowerGadgets MVP
http://www.powergadgets.com/mvp

Blog:
http://marcoshaw.blogspot.com
My System SpecsSystem Spec
Old 10-01-2007   #8 (permalink)
chucksweety


 
 

RE: same beginners questions

I'm confused. I have this command that I'm using in Powershell that works
(type C:\temp\computers.txt | % { $_; gwmi -computername $_
win32_logicaldisk -filter "drivetype=3" | % { $_.deviceid; $_.freespace/1GB }
} | out-file c:\temp\FreespaceResults.txt) What I would like to do is
schedule a task to run it and then e-mail me a copy of the results. However,
if I set this up as a scheduled task, it doesn't work. I setup the task with
this command calling a text file with the above mentioned command line.
Powershell -Command c:\temp\freespace.txt. It just pops up the text file and
then a cmd prompt window pops up and goes away. I see no errors. Any
suggestions appreciated. thanks

"RichS" wrote:
Quote:

> To answer your questions in order:
>
> 1) PowerShell uses .NET 2.0 .NET 2.0 must be installed before PowerShell
> can be installed. You may be able to use functionality from .NET 3.0
> depending on what it is and loading the assembly into PowerShell
>
> 2) if you want to run a powershell script from the cmd prompt then you use
>
> powershell.exe -Command "path to script"
>
> you can see the full syntax by using powershell /?
>
> 3) You can download PowerShell from here
> http://www.microsoft.com/windowsserv.../download.mspx
> There are versions available in languages other than English. I would use
> the appropriate language for your machine.
>
> 4) PowerShell cannot control other computers directly at the moment. You
> can use WMI and .NET functionality to control remote machines. There are
> some remoting add ons available for PowerShell
> --
> Richard Siddaway
> Please note that all scripts are supplied "as is" and with no warranty
> Blog: http://richardsiddaway.spaces.live.com/
> PowerShell User Group: http://www.get-psuguk.org.uk
>
>
> "HassanMullah" wrote:
>
Quote:

> > hello,
> >
> > i just begin with learning ms powershell. no i'm first by reading the
> > whitepapers. but now i have i few questions.
> >
> > 1.) can i use ms powershell also with .net 3.0 or only with .net 2.0
> > 2.) how do i start ms powershell outside the powershell - i mean how
> > do you start "ps-batch" script from a cmd.exe ?
> > 3.) need i a englisch ms powershell for english OS, and a german ms
> > powershell for german OS, or is that not important what language i
> > have ?
> > 4.) can i use ms powershell on my computer, to control other computers
> > in the network, which have .net 2.0 / 3.0 but no the ms powershell
> > installed ?
> >
> > kind regards
> >
> > Hassan
> >
> >
My System SpecsSystem Spec
Old 10-06-2007   #9 (permalink)
Kirk Munro


 
 

Re: same beginners questions

Hi Chuck,

In your example below, PowerShell is doing just what you tell it to. When
you execute nothing but a path to a text file, that text file will open in
its default editor, which is why you see the file in notepad. The console
then closes because you didn't tell it to stay open.

There are a few things you should know about running PowerShell scripts
through PowerShell.exe:
1. If you don't want the console to close, you need to specify -NoExit on
the command line.
2. If you want PowerShell to run a script, script files should be saved with
the .ps1 extension.
3. (only important if your script file path has spaces) If your script file
path has spaces, you need to pass it in differently.

Here are two examples:

powershell -noexit C:\Test.ps1

and

powershell -noexit "& ""C:\Documents and Settings\kmunro\My
Documents\Test.ps1"""

-
Kirk Munro
Poshoholic
http://poshoholic.com

"chucksweety" <chucksweety@xxxxxx> wrote in message
news:A2CAB1D6-EC28-4D8E-9571-4F692D16D1DC@xxxxxx
Quote:

> I'm confused. I have this command that I'm using in Powershell that works
> (type C:\temp\computers.txt | % { $_; gwmi -computername $_
> win32_logicaldisk -filter "drivetype=3" | % { $_.deviceid;
> $_.freespace/1GB }
> } | out-file c:\temp\FreespaceResults.txt) What I would like to do is
> schedule a task to run it and then e-mail me a copy of the results.
> However,
> if I set this up as a scheduled task, it doesn't work. I setup the task
> with
> this command calling a text file with the above mentioned command line.
> Powershell -Command c:\temp\freespace.txt. It just pops up the text file
> and
> then a cmd prompt window pops up and goes away. I see no errors. Any
> suggestions appreciated. thanks
>
> "RichS" wrote:
>
Quote:

>> To answer your questions in order:
>>
>> 1) PowerShell uses .NET 2.0 .NET 2.0 must be installed before
>> PowerShell
>> can be installed. You may be able to use functionality from .NET 3.0
>> depending on what it is and loading the assembly into PowerShell
>>
>> 2) if you want to run a powershell script from the cmd prompt then you
>> use
>>
>> powershell.exe -Command "path to script"
>>
>> you can see the full syntax by using powershell /?
>>
>> 3) You can download PowerShell from here
>> http://www.microsoft.com/windowsserv.../download.mspx
>> There are versions available in languages other than English. I would
>> use
>> the appropriate language for your machine.
>>
>> 4) PowerShell cannot control other computers directly at the moment.
>> You
>> can use WMI and .NET functionality to control remote machines. There are
>> some remoting add ons available for PowerShell
>> --
>> Richard Siddaway
>> Please note that all scripts are supplied "as is" and with no warranty
>> Blog: http://richardsiddaway.spaces.live.com/
>> PowerShell User Group: http://www.get-psuguk.org.uk
>>
>>
>> "HassanMullah" wrote:
>>
Quote:

>> > hello,
>> >
>> > i just begin with learning ms powershell. no i'm first by reading the
>> > whitepapers. but now i have i few questions.
>> >
>> > 1.) can i use ms powershell also with .net 3.0 or only with .net 2.0
>> > 2.) how do i start ms powershell outside the powershell - i mean how
>> > do you start "ps-batch" script from a cmd.exe ?
>> > 3.) need i a englisch ms powershell for english OS, and a german ms
>> > powershell for german OS, or is that not important what language i
>> > have ?
>> > 4.) can i use ms powershell on my computer, to control other computers
>> > in the network, which have .net 2.0 / 3.0 but no the ms powershell
>> > installed ?
>> >
>> > kind regards
>> >
>> > Hassan
>> >
>> >

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Beginners questions PowerShell
VM beginners Virtual Server
Vista For Absolute Beginners General Discussion
Encryption for beginners Live Mail


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46