Group:  English: General ยป microsoft.public.windows.powershell

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Threads Replies Last Post
22 Pages: 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  
Halting a command that doesn't end
I am using a program called DoubleTake which has a command that logs replication (dtstat). The problem is the command doesn't stop running until I hit ctrl-c. I want to use powershell to parse the output but I cant get the executed command to stop so that the powershell script can continue. basically the program outputs about 15 lines of data every time it querys and keeps repeating. I ju...
8 21.05.2007 20:12:53
Possible bug in Switch -File
I might have missed how to get around this, but it appears that the Switch statement with the -File option tries to get a file handle with more permissions requested than just plain old Read. Hence, the following produces an error about the file being used by another process: $fwlog = "C:\Windows\system32\LogFiles\Firewall\pfirewall.log" switch -file ($fwlog) { default {"do some...
2 21.05.2007 19:17:12
Bug calling [gc]::collect()
Occasionally I have a need to force certain file handles to be closed so I call [gc]::collect(). But this syntax isn't working for me: 811# [GC]::collect() Unable to find type [GC]: make sure that the assembly containing this type is loaded. At line:1 char:5 + [GC]: <<<< :collect() It should work though. PoSh should prepend "System." to "GC" when it can't find "GC" in ...
9 20.05.2007 08:13:40
Robocopy functionality
Has a robocopy like cmdlet been created for Powershell? ...
12 19.05.2007 00:17:54
listing "dot sourced" functions
I'd like to be able to list the functions that have been dot sourced in my PowerShell profile, preferably with all parameters, even if they cross line boundaries. It's probably simple, but how? Thanks! -Dave...
6 18.05.2007 23:50:03
SMTP sciplet for Powershell
I asked about this a couple months ago and you guys pointed me to a nice freeware set that included a "mail" command to send SMTP emails. I lost the website and need to download it again. Thanks!...
4 18.05.2007 22:44:43
pspad + powershell
Hi, i'm using PSPad as PS editor now, and i've seen that it is possible to associate a help file (.hlp) to each language; i've already found some clip files nd def files for autocompletion, but would you have a hlp file corresponding to monad / powershell with the content of get-help or such a thing ? bye Nico ...
3 18.05.2007 20:29:01
Open file for exclusive access
Hi, I would like to open a file for exclusive access for the duration of a script. If the script fails or finishes the lock must be released. This is to prevent another user or process from accessing the same data file. I have googled to no avail. Thanks in advance ...
16 18.05.2007 17:54:23
Capture SQL Messages
How do capture SQL Messages ? lets say I have a SQL stored procedure that use print statements. In query analyser the results of the print statements they would appear in the message tab. How can I capture these messages in a Power shell script ? Thanks ...
5 18.05.2007 15:46:45
Creating a hashtable in the pipeline?
I would like to create a hashtable with the result from a pipe. The mission is to read a file and create a hashtable with a linenumber. Like lnum line 1 something 2 some other stuff 3 even more.... .... ... I tried with $lines = gc "c:\test.txt" | &{$a=0}{$a++; @{lnum=$a; $line=$_} } but $lines is empty. What is the tric...
3 18.05.2007 13:03:08
Filter a hashtable?
Hi I have a hashtable from which I would like to list only some rows depending on filters given as arguments to a function. Is it possible to filter a hashtable? How can this be done? Thanks ...
2 18.05.2007 06:18:52
Writing a cmdlet: using a variable named "object"
C# novice... It would appear that "object" is a reserved word in C#. At least I cannot seem to easily declare a variable with the name "object". I'm writing a cmdlet, and I actually want one of the parameters to be named "object". Is there some way I can make it work? For now, I just do something like this: private string _myObject; [Parameter(Position = 2)] ...
4 18.05.2007 00:34:55
output of long lines gets split in PS console
Hi, I a PS script which does a SQL query and then writes the output via: write-output "$teststring, $teststring2". The 2 variables combined are 132 characters long and it seems to split the output into 2 lines at char 120. Can someone tell me how to get 1 long string? thanks, ...
6 17.05.2007 19:52:37
Encryption using secure key
Hello All, I am trying to decrypt a string to plain text using an example I found on /\/\o\/\/'s blog which referenced a post in the news group. I'm doing it like this: $strString = convertto-securestring $strString -securekey $strServerKey $ptrPassword = [System.Runtime.InteropServices.marshal]::SecureStringToBSTR($strString) $strString = [System.Runtime.InteropServices.marshal]::...
1 16.05.2007 22:51:01
foreach, foreach-object & begin/process/end scriptblock clauses...
This is a multi-part message in MIME format. ------=_NextPart_000_0006_01C792F0.493B5520 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable My apologies if this has been asked 1,001 times (I did do some = searching, and re-read the sections in Bruce's book & only now am asking = ^_^): How does one use the begin/process/end clauses with the for...
13 16.05.2007 22:30:52
Everything has ellipses.....
No matter how large I expand the PS window, the PS output is truncated with ....... and I can't read all the output. Example from the Exchange Shell Get-StorageGroup -Identity 53adf20a-1d5b-413f-a8e2-996dea | Get- ADPermission | findstr "Send" Results are in 4 colums each one cut off with ...... at the end. Please help me as this is driving me crazy! ...
3 16.05.2007 19:33:12
Accessing remote COM Objects
Can i access a remote COM object with powershell? New-Object doesn't provide a -computerName parameter like CreateObject has an optional ServerName property... -- Joris van Lier Please note that all scripts and opinions are supplied "as is" and with no warranty Blog: http://whizzrd.spaces.live.com ...
4 16.05.2007 19:14:36
DNS Object
My mission is to interrogate Active Directory DNS properties. What I have done so far is a parallel experiment to interrogate Active Directory $Dom = 'LDAP://DC=xyz;DC=com' $Root = New-Object DirectoryServices.DirectoryEntry $Dom $Root |get-member My questions are a) For DNS, what should I Use instead of DirectoryServices.DirectoryEntry b) Is it possible to get a lis...
4 16.05.2007 18:07:56
PowerShellLanguage reflector addin
There's a new add-in for Reflector to emit PowerShell code. http://www.codeplex.com/reflectoraddins For those unfamiliar with reflector, it allows you to look at the sourcecode of .NET assemblies in your favorite language, last time i checked it supported C#, VB.NET and Delphi, with the new add-in you can look at the code in the PowerShell language. Atleast you're supposed to be able to ...
3 16.05.2007 15:45:10
Stumped by variable substitution
What did I do wrong here? Why does the "\microsoft[1].txt" gets ignored? PS C:\> $CookieFile=$env:UserProfile.ToString()+"\"+$Env:username.ToString()+"\microsoft[1].txt" PS C:\> $CookieFile C:\Documents and Settings\kingkong\kingkong\microsoft[1].txt PS C:\> get-content $CookieFile Get-Content : Cannot find path 'C:\Documents and Settings\kingkong\kingkong' because it does not...
8 16.05.2007 08:03:05
Help with script on service
Hey all, I have been playing with powershell for a few weeks now but I need to write a script that is way beyond my knowledge so far. I need to change the service "Remote Procedure Call" to log in with local system account. Is there an easy way to do this in powershell? I have a list workstations.txt I can call to run WMI against but I do not know the command to change the value. Th...
5 15.05.2007 21:31:12
grep -r equiv
Hi, What is the preferred method to doing the equivalent of "grep -r". I tried: get-childitem *.ps1 | get-content | select-string "somestring" but it seems to only get the top level .ps1 sripts. thanks in advance, ...
5 15.05.2007 21:19:55
Missing cmdlet
Hello All, I am checking out some of the examples from the book, "Windows PowerShell in Action" by Bruce Payette and it appears that either the book is wrong or I am missing some cmdlets. I'm trying to run the Get-DomainInfo and it's not there, nor is the next one Get-SoftwareFeatures. When I do a help get* there not listed either. Any suggestions? Am I doing something wrong? Th...
5 15.05.2007 19:46:03
get-wmiobject Win32_QuickFixEngineering doesn't show patch
Hi, When I try to verify my office patch install, I don't see it but when I go to add/remove programs, it does show it. Can someone tell me how to verify Office updates via PS? $server = testserver get-wmiobject -class "Win32_QuickFixEngineering" -namespace "root\CIMV2" ` -computername $server |select-string KB933688 Thanks, ...
5 15.05.2007 19:37:49
Argument that starts with '-' and contains ':' gets separated.
I discovered that when I execute a program from the PS command line and I try to pass an argument that starts with a hyphen (-) and contains a colon (:), the argument will be split into 2 arguments at the colon. To demonstrate, I wrote a simple python script then merely echoes out all the arguments in argv: PS C:\3rdParty> .\testPSArgs.py c:\goodbye arg: C:\3rdParty\testPSArgs.py ar...
5 15.05.2007 18:50:57
22 Pages: 1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  18  19  20  21  22  

Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net