powershell-v1.0

Powershell remoting with V1

Do you know of any good remoting solutions using powershell V1 (I know the V2 stuff is awesome, but my organization doesn't like using pre-release software). I don't need anything spectactular, just a way to kick off powershell script on another box and get the results back when they're done. I'm considering using sysinternals PSEXEC a...

Using PowerShell with .NET 3.5 runtime/libraries

Is it possible to run PowerShell 1.0 (or 2.0 CTP) backed by the 3.5 runtime instead of 2.0? We're building a .NET 3.5 solution, and I'd still like to use PowerShell as our scripting engine for scheduled tasks, etc. I don't need LINQ syntax or anything, just the 3.5 libraries and runtime. FOLLOWUP: thank you for the reply about dynam...

PowerShell: Performance of .NET methods calls

Is it possible to call a .NET method from PowerShell with early binding? I have a pipeline script which calls a single .NET method in process {...}. PowerShell calls this method via reflection, and right now Invoke (not the method itself, just reflection call) takes 70% of total execution time. The method is always the same, so I would...

How can I find the source path of an executing script?

I want to be able to tell what path my executing script was run from. This will often not be $pwd. I need to call other scripts that are in a folder structure relative to my script and while I could hard code the paths, that's both distasteful and a bit of a pain in the neck when trying to promote from "dev" to "test" to "production". ...

How to Remove ReadOnly Attribute on File Using PowerShell?

Hi, How can I remove the ReadOnly attribute on a file, using a PowerShell (version 1.0) script? Thanks, MagicAndi ...

Is it possible to have many pipelines for 1 runspace.

Hi, This is executing scripts asynchronously from c# and having threads doing the work of loading the script for execution and waiting for output to come out. I may need to have many scripts executing at once, maybe concurrently. Is possible to have a 1:M relationship between runspace and pipelines in windows poweshell and if so what...

Powershell not loading profile when running through PSEXEC

I am working with powershell 1.0 using PSEXEC to run scripts remotely (or on the same box in a batch mode). On my machine, the "remoted" powershell session correctly loads my profile.ps1 (from the MyDocuments folder), but on another machine, it doesn't. I'm not passing in the -noprofile switch to the powershell.exe, and I have verified...

Powershell.exe running the script in cli, or a wrapper?

Hi all! I have a third-party application that's extensible by adding exe-files that perform dataconversion etc. I've written an extension in Powershell that does the conversion I want, but I'm unable to get the third-party app to run my ps1, as it will only accept an .exe file as an extension. The app adds a filename as the first (and o...

PowerShell Script to automate data entry to OpenOffice Calc Spreadsheet

Hi, I would like to be able to automate data entry to an Open Office spreadsheet using a PowerShell script, in the same way that Excel can be automated using PowerShell (see this Scripting Guy example). Is this possible? Thanks, MagicAndi ...

Ouput redirection/capturing issue with Powershell and Try-Catch and external EXE

First off, either A) I'm not investigating into this hard enough or B) I've found a problem that requires some funky hack. By the way this is posh v1.0. Here it goes: A week or so ago I asked a question about redirecting the output from the exection of an EXE in powershell that was otherwise not being caught. I was swiftly presented wi...

c# Powershell. Configure runspace using RunspaceConfiguration.Create

Hi, I'm trying to find out how the RunspaceConfiguration.Create() method call is used. I want to set the c# hosting up, in a manner that will enable any conceivable powershell script from executing from c# by ensuring all Cmdlets, Providers etc, are available. Looking at the powershell samples, sample 5, it's got the following. Runspa...

Can I use PowerShell 1.0 to list processes along with their PIDs and Command Lines?

EDIT by OP: My question presupposed that PowerShell was the best tool for this job. There is a simpler way of achieving my goal. A friend just told me about: iisapp.vbs. It displays exactly the info I need without requiring PowerShell. I'm working with dozens of ASP.NET websites running locally and when I want to debug a particular...

Capturing Powershell output in C# after Pipeline.Invoke throws

I'm running a Powershell test script from a C# application. The script can fail due to a bad cmdlet which causes pipe.Invoke() to throw an exception. I'm able to capture all the information I need about the exception, but I'd like to be able to display the script's output up to that point. I haven't had any luck since results appears to...

Power Shell Installation Vista error

When I try to install PowerShell (Windows6.0-KB928439-x86.msu), I get this message box: "Class not Registered" Any help ? ...

Identify the PID of a Executing Batch File in Powershell

Hi, I need to identify the P(rocess) ID of an executing batch file from a PowerShell (v1.0) script. Can anyone suggest a way of doing this? Thanks, MagicAndi. ...

PowerShell 1 is not capturing batch file output with tee

PowerShell can call commandline batch files. PowerShell script output can be recorded with the "tee" command. But the tee command does not record the output of batch files inside a PowerShell script for me in PowerShell 1. Try this cut-down example: Make a batch file, called test.bat, with contents @echo hello from bat Run it from P...

FTP error in powershell

I'm writing a fairly simply script and I'm trying to upload a file to an ftp server. I'm using the following command ftp -n -s:upload.txt 292.78.51.12 (I've faked the IP) It works perfectly in command prompt but it seems to have a problem with it in powershell. I've tried giving the absolute path to upload.txt, put .\ before it and no...

Unable to obtain physical memory informatin using powershell

I am having trouble getting physical memory information from windows management objects using powershell. The columns are generated in the excel spreadsheet yet there is no data found in the Winmgmt object. $strComputer = “.” $Excel = New-Object -Com Excel.Application $Excel.visible = $True $Excel = $Excel.Workbooks.Add() $Sheet = $...

Locate Compressed files on servers

Hi, I would like to create a powershell script generating a report showing all compressed files/folders on remote servers. By compressed files I mean files compressed using the buildin Windows Compression utility, not zip. But I have a hard time figuring out how to localize the compressed files. Should I go with WMI or? Thanks Frank ...

How can I change the IP address of all sites in IIS6 using powershell 1.0?

Using Powershell 1.0 under Windows Server 2003 with IIS 6. I have about 200 sites that I would like to change the IP address for (as listed in the website properties on the "website" tab in the "Web site identification" section "IP address" field. I found this code: $site = [adsi]"IIS://localhost/w3svc/$siteid" $site.ServerBindings.In...