|
Newbie Question - PS on Longhorn Beta 3
I just installed LH Betra 3 on a x64 proc. I'm ultimately trying to install
Exchange 2007. I have to install PS first before installing Exchange. I've
got up to PS site and downloaded PS for LH ver 5600. I run the executable
and I get the following "The update does not apply to your system"
Help?
Robert...
|
3 |
09.05.2007 00:53:33 |
|
Remote access to registry data
Hi; how could i get the modify the registry database of a remote computer ?
i've seen i can use the PSdrives locally, but how to do it by remote ?
bye
Nico
...
|
8 |
09.05.2007 00:50:53 |
|
redirecting file output to .exe
How do I redirect output from a file into standard in of a .exe?
This works with cmd.exe:
c:\>myApp.exe < list.txt
But this doesn't work powershell.exe:
C:\>myApp.exe < list.txt
The redirection operator '<' is not supported yet.
At line:1 char:12
+ myApp.exe < <<<< list.txt
...
|
4 |
09.05.2007 00:13:12 |
|
Problems with -replace and Get-Location
Okay, I'm writing a script to copy all files (excluding files with ps1
extension) to a remote FTP server. So, for the string representing
each file in the current directory, I want to replace the path of the
current directory with ".\". Here's how I tried to do that (I'm just
Write-Host'ing the output for illustration purposes):
$files = Get-Item * -exclude *.ps1
foreach($filename in $fi...
|
4 |
08.05.2007 19:06:31 |
|
Error I cannot explain.
This is a multi-part message in MIME format.
------=_NextPart_000_000E_01C79149.55356030
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
A few times now I have recieved the error:
PS H:\ # gwmi -class Exchange_Mailbox -namespace =
ROOT\MicrosoftExchangeV2 -computer adm-mail
Get-WmiObject : The handle is invalid. (Exception from HRESULT: =
...
|
1 |
08.05.2007 15:17:35 |
|
PS doesn't work with custom cultures under Vista
We're using custom cultures with exotic settings for date/decimal etc.
With Windows XP I could register these cultures for .NET env only,
starting with Vista they are installed for the whole system.
Most of the apps are recognizing the settings, soime ignore it. But
Powershell won't run at all. If you set the culture during a PS session
you get
>
PS C:\Users\thkrause> Get-Culture
...
|
4 |
08.05.2007 13:54:39 |
|
Automating iTunes.
Hi,
I was trying out automation of iTunes and was able to start, play a
file and do a good amount of work with PowerShell.
All what I could do was call a function which accepts either no
parameters or parameters known to PowerShell like string etc.,
How can I create parameters of built-in (exposed via interface) itunes
classes and pass it to some methods of itunes.
As an example,
I create ...
|
3 |
08.05.2007 07:31:54 |
|
signature of tabexpansion function subobptimal
Hi,
When implementing tab completion, it is limiting to only be able to affect
the last word of the line.
I think it would be interesting to start a discussion of what we would want
from tabexpansion and what means we need to achieve it.
I'm certain other people have been frustration with cmd/powershell removing
everything after the current completion when editing an interior part of ...
|
3 |
08.05.2007 03:20:11 |
|
RoboCopy's mirror functionality in PowerShell
I saw this script on another post that will copy all the changed files
to a new location. I am sure this can be tweaked to perform the other
various functions of robocopy as well, but in particular, can it be
modified to perform the delete functions of RoboCopy mirror as well.
What about NTFS security, etc?
$changedFiles = dir | where { $_.Attributes -band
[System.IO.FileAttributes]::Arch...
|
4 |
07.05.2007 21:26:41 |
|
Out-File after Format-Table via a filter
This is a multi-part message in MIME format.
------=_NextPart_000_0331_01C78E59.1F4222D0
Content-Type: text/plain;
charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
If I type this into the shell all works as I would expect it to:
$LogToFile =3D $true
filter Log {if ($LogToFile) {$_ | Out-File -append foo.log} else {$_}}
gci env: | Log
But if I type the following ...
|
5 |
07.05.2007 17:38:37 |
|
Array Slicing - Powershell compared to Python
Hi,
I guess this is a question for the Powershell team.
When comparing array slicing with for example Python, I find that Powershell
does not support doing what i most often use slicing for, ie "Get all but
the first/last n items".
In python you can write
somelist[:-3]
to get all but the last three (and the empty list if there are less than
three elements in the list)
In powers...
|
3 |
07.05.2007 16:05:42 |
|
Set-ExecutionPolicy Unrestricted
Hi,
I want to start ps1 scripts over UNC paths or mapped network shares. I tried
to change the execution policy to unrestricted but I always get the
following prompt:
Security Warning
Run only scripts that you trust. While scripts from the Internet can be
useful, this script can potentially harm your
computer. Do you want to run \\blablabla\bla?
[D] Do not run [R] Run once [S] Sus...
|
29 |
07.05.2007 14:05:03 |
|
Finding who modified a file?
Can Powershell find out who made the last modification to a file on a
shared folder?
...
|
7 |
06.05.2007 09:48:35 |
|
powershell and the DLR?
>From Mix there's been a lot of talk about this Dynamic Language
Runtime, helping languages like IronPython, IronRuby et al to get
great performance on top of the CLR.
Well -- our favourite dynamic language from redmond is of course
Powershell!!
Has powershell been left out in the cold on this one? Or is there talk
of how it too can utilise the DLR?
Otherwise I can foresee powershe...
|
6 |
06.05.2007 05:17:23 |
|
How to pass credentials to Authentication Window on the web.
Hello all,
In powershell, how can I pass the credentials to a authenticaiton window of
a web site.
Assuming I wish to nagivate to www.yahoo.com/admin and I get prompted for
the network username and password, how can I provide these two fields with
the proper value from PowerShell without being prompted for the dialog window.
I know I'll have to save the password in some secure file ...
|
7 |
05.05.2007 23:08:43 |
|
Querying for a COM Interface
I have come from a C++ background where I have used the following to work
with COM
CComPtr<IBuilder> builder;
builder.CoCreateInstance(__uuidof(Builder));
CComQIPtr<IPersist> loader(builder);
I can see how to use new-object -comobject to create the builder object, but
how do I go about getting the IPersist interface?
Is there a example/tutorial on using COM in Powershell...
|
2 |
05.05.2007 23:00:16 |
|
Binding a powershell variable to the COM Object of a running application.
Hi,
I want to bind a variable $ie to an already opened Internet Explorer
Window.
How can this be done?
For single instance applications like itunes or media player,
$itunes = New-Object -comobject ITunes.Application
binds the shell variable to the running itunes app. (if itunes is
running or creates a new instance.)
How can this be done for other applications like, IE, Winword,
powerp...
|
6 |
05.05.2007 22:56:42 |
|
psh and prnadmin.dll
The following code results in an error:
$master = new-object -com PrintMaster.PrintMaster.1
$master.Drivers()
Exception while calling of "Drivers": The data area passed to a system call
is too small
Has anyone a solution? Is this a bug?
The other methods like 'Forms' or 'Ports' of the Printmaster-object in PSH
work .
The method Drivers() works in Vbscript/Perl/Python.
It seems to ...
|
4 |
05.05.2007 22:55:16 |
|
PowerShell and Click Once
Hello, first time poster!
I'm currently investigating if PowerShell can:
-Open an Internet Explorer browser.
-Navigate to a given URL
-Click on the given hyperlink which is basically a .application
i.e.: <a href="myApp.application">Click here to launch application</a>
-Once the hyperlink is clicked, the application basically launches and waits
for a username and password.
...
|
3 |
05.05.2007 22:53:09 |
|
Free offer: let me write a cmdlet for you
I'm wanting to get more experience with C# and writing cmdlets. I'm
offering to write a free cmdlet for anyone asking. I'm not a C# expert,
so I will *try my best*. I might even archive more difficult requests
for when I get more experienced.
Advantages:
*Can usually run faster.
*Your "intellectual property" is protected.
I'll provide you with the cmdlet, as well as the source.
...
|
3 |
05.05.2007 22:37:21 |
|
WMI calls problem
Hello,
I am trying to gather Serial Numbers, Install Dates, and Servers name for a
list of servers in my production environment. I have run into several snags
and I need help!
1) The wmi query to gather the information above is in two different
classes. So for each server I need to be able to query the win32_bios, and
win32_OperatingSystems classes.
2) I need to be able to merge...
|
4 |
05.05.2007 21:49:00 |
|
Using dynamic type as function parameter
I'm having an issue using a dynamic type as a function parameter in a script
file.
I dynamically define and create the enum first, and then attempt to define
a function with the enum type as a parameter. For example:
New-Enum "MyType" Red Blue Green
#(from
http://blogs.msdn.com/powershell/archive/2007/01/23/how-to-create-enum-in-powershell.aspx )
function MyFunction ([string] ...
|
1 |
05.05.2007 19:53:00 |
|
iTunes & Powershell
This is a multi-part message in MIME format.
------=_NextPart_000_0006_01C78BE9.35200440
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hello Group,
I'm using itunes using methods and properties available via powershell.
$tunes=3Dnew-object -com itunes.application.
When I finish listening songs I try to close the GUI interface, itunes ...
|
4 |
05.05.2007 17:35:59 |
|
PInvoke and Decimal to Binary Conversion
I'm trying to wrap my head around binary arithmetic, since i've been given the task to automate a Programmable Logic Controller.
The PLC comes with a DLL and some VB6 Example code with Declarations that i want to convert to Powershell.
First question
Anyone know of examples of PInvoking in Powershell?
Can PInvoke done using powershell alone or do i have to create a .NET Wrapper Assembly and...
|
3 |
04.05.2007 22:48:23 |
|
ERROR: Drive root "P:\" does not exist or it's not a folder.
I am curious to know why I get this error every time I start PowerShell
Drive root "P:\" does not exist or it's not a folder.
Guy
...
|
4 |
04.05.2007 19:19:48 |