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  
Casting string into scriptblock
I think it should be possible to cast a string directly into a scriptblock. AFAIK the only way to do this right now is to use the invoke-expression cmdlet. Any reason why we can't use type casting for this purpose? PS> $string = '{echo test}' # does not work: PS> $sb = [scriptblock]$string Cannot convert value "{echo test}" to type "System.Management.Automation.ScriptBlock". Er...
3 05.07.2007 18:30:37
Select from output while using ParseExact?
Hi all, This is my first PowerShell script so please be gentle :) I'm attempting to pipe PowerShell output to PowerGadgets. I have a .CSV file containing two values, a metric_time and a metric_value (i.e. Wed Apr 25 10:42:18 PDT 2007,14532). I'm attempting to output the contents of the file while translating the date value to something PowerGadgets can understand. Here's the script:...
7 05.07.2007 17:22:29
Parsing a text file
I have a ugly formatted text file. At least, I know the format used to create it. It is something like this: FIELD/HEADER STARTING COLUMN LENGTH Given Names 8 35 Surname 44 35 So the file looks something like: Given Names Surname xxx yyy zzzz aaaaa There are other headers. How c...
5 05.07.2007 17:13:49
associate .ps1 filetype with powershell
What would be the best way to associate the .ps1 filetype with powershell? So that doubleclicking a .ps1 will result in execution of the script? Generally I would like use .ps1 as a replacement for .bat on my local dev machine. ...
4 05.07.2007 16:00:20
Powershell Analyzer 4th of July Sale
We are joining the throng of merchants cheapening our democracy with shameless commercialism. So, today only. You can buy Powershell Analyzer for only $47.07 . I know the date format 4/7/07 is decidedly non American, but would you rather pay $74.07 ? http://www.powershell.com/store Buy now and declare your independence from the windows console subsystem, and enter into the freedom of ...
8 05.07.2007 07:10:44
Active Directory: getting a list of users
I've not much experience with AD... I'm got PSCX 1.1.1, so was going to use the AD provider from it. (Unless the Quest AD cmdlets would make my life easier here.) I need to get a listing of *all* users within AD. There are several containers, so I was thinking I might have to recurse through all the folders to look for items of the type 'user'. But then there's also the domain\grou...
5 04.07.2007 22:49:02
Newbie to Powershell
Hello All, I am new to powershell and was wondering if someone could show me how to get information on CPU usage on a remote server on my Xp desktop. The I can examine it and get some kind of understanding on powershell scripting. Thanks for any help....
2 04.07.2007 21:28:09
Slightly OT - editors
Being an old g*t I've used countless file editors, those that I've used for serious periods of time include vi Xedit TextPad Notepad2 Notepad++ GVim But I've just found another that for some reason I've never come across before - EditPad Pro* here: http://www.editpadpro.com/ I'm highly impressed and shelled out for a full version a day after downloading the trial. Syntax support fo...
19 04.07.2007 20:24:17
.net framework tutorial/explanation for the IT Pro using Powershel
Apparently the more you know about .net framework the better for Powershell. As an IT pro is there a good refrence and tutorial on .net framework? I am not lookingf for programming information more of its architecture and how it works. I love the reg exp's......
4 04.07.2007 17:58:06
Find AD schema information
Hi, hope someone can help I am writing a script that I can use to find one or more properties of computer objects in the active directory. The problem I have is getting a list of available properties from the schema. My script currently uses System.DirectoryServices.DirectorySearcher.FindOne method to return a directory entry object for the first computer entry found, searching from...
5 04.07.2007 17:30:22
Hashtable with array as a key .... weird behaviour
Pls, check this code.... $a = @("jmeno", "stutu", "tata", "titi") $b = @(1, 2,3, 4, 5) $h = @{} $b | %{ $h[$a] += @($_) } ------------- variable $h has first 4 elemens null. If the key ($a) is value object then everything is OK. This is really really weird. I cannot find any explanation for this behaviour... Thx... ...
3 04.07.2007 15:23:42
How to rename files with brackets in the filename
I am trying to rename files which have brackets in the filename using the following command: rename-item "test[0].txt" -newname test0.txt Unfortunatelly the command returns the following error: Rename-Item : Cannot rename because item at 'test[0].txt' does not exist. At line:1 char:12 + rename-item <<<< "test[0].txt" -newname test0.txt Has anyone any idea how to accomplish...
9 04.07.2007 12:50:00
My effort to give back
This is a multi-part message in MIME format. ------=_NextPart_000_0006_01C7BD8A.0197F1A0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable What could I do for a community that has given and taught me so much but = to try and give something back? I've started up a blog that hopefully = will prove useful to some folks out there. If you have some...
2 04.07.2007 11:44:03
previous versions ?
Hi, is it possible to retreive previous versions of some files with powershell -> retreive a list of all previous versions of a file -> restore the file at a particular version bye Nico ...
8 04.07.2007 11:28:08
submit page
I have 4 butoons in my web page.(Insert,Update,Delete,Cancel).Each of these buttons perform different actions and redirects to different pages.Please help how to do this PowerShell ...
1 04.07.2007 11:28:00
Is there any alternative for the shell window?
Standard shell is really very awkward :(...
9 04.07.2007 09:16:50
WMI's IIS Namespace on a remote computer using Powershell
Has anyone tried to use Powershell to query the microsoftiisv2 namespace using powershell? Every time I try I get an 'Access denied'. If I try to query the root/cimv2 namespace I don't have any issues. If I try to query the microoftiisv2 namespace locally, I don't have any issues. I have also tried the -credential option as well but no luck . . . The query that I am trying is G...
8 04.07.2007 05:32:09
Problem in loading DLL to powershell
I am trying to load DLL to PowerShell.I have written the following code . [Reflection.Assembly]::LoadFile("c:\temp\MyMathLib.dll").But I am getting the the error message "Exception calling "LoadFile" with "1" argument(s): "Absolute path information is required." " ...
7 04.07.2007 00:01:47
creating a byte array to read in image
Hi, Is it possible in PS create a byte array to read in an image to store into a SQLServer database table? Thanks, ...
4 03.07.2007 22:56:43
get whole session output from inside C# application
I posted to this question http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx?dg=microsoft.public.windows.powershell&tid=86b6726e-a852-4a21-a59f-87cb5dfdb234&cat=&lang=&cr=&sloc=en-us&p=1 regarding how to log session output from inside C# I am now doing the following: private static string RunPowerShell( List<string> commands ) { ....more code... ...
2 03.07.2007 16:22:47
[WMIClass] versus get-wmiobject
Can someone explain why these two statements produce different results and what it means? 1# $a = get-wmiobject win32_process TypeName: System.Management.ManagementObject#root\cimv2\Win32_Process 2# $b = [wmiclass]"\\localhost\root\cimv2:win32_process" TypeName: System.Management.ManagementClass#ROOT\cimv2\Win32_Process They are quite different in that the latter ($b) has a Create(...
10 03.07.2007 14:29:01
log output from invoke-expression
Hi, How would one log all output including errors via "invoke-expression $cmd" ? thanks, ...
5 03.07.2007 12:44:01
IDEA: Strongly typed scriptproperties
one problem of making custom dynamic objects in powershell is the properties are generic and can't be made "strongly typed" as can powershell $variables. so I'm brainstorming some ideas to do this.. The way i am trying this is to use add-member to add a scriptproperty that uses a scriptblock to get and to set the value. The downside is the value can't be a private field sicne powershell ob...
8 03.07.2007 04:31:50
Redirecting StandardOutput from a cmdlet
Hi, I'm writing a cmdlet which must interact with an unmanaged dl which itself outputs to stdout. In my cmdlet's ProcessRecord, I attempt to grab Powershell's StandardOutput, so that I can capture the output from my unmanaged code and send it along the pipeline in a formatted fashion. Example: protected override void ProcessRecord() { Process cp = Process.GetCu...
1 03.07.2007 04:05:35
Redirecting StandardOutput from a cmdlet
Hi, I'm writing a cmdlet which must interact with an unmanaged dl which itself outputs to stdout. In my cmdlet's ProcessRecord, I attempt to grab Powershell's StandardOutput, so that I can capture the output from my unmanaged code and send it along the pipeline in a formatted fashion. Example: protected override void ProcessRecord() { Process cp = Process.GetCu...
1 03.07.2007 03:57:02
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