Search found 99 matches

by EBrant
Sun Sep 16, 2012 2:58 am
Forum: Windows PowerShell
Topic: paid one-to-one Training
Replies: 1
Views: 1256

paid one-to-one Training

Hello All, Would anyone interested in doing some paid one-to-one teaching? my company said they may fund this for me i.e. WebEx into my PC/Lab (we have WebEx account). Can pay via paypal for example and claim back on my company expenses (need to agree the actual fee with my boss first). An hour hear...
by EBrant
Sun Sep 16, 2012 2:40 am
Forum: Windows PowerShell
Topic: [Parameter(Mandatory=$true)] makes %errorlevel% always return 0
Replies: 2
Views: 842

[Parameter(Mandatory=$true)] makes %errorlevel% always return 0

Thanks Jim, good to know not just happening on my system, I will report it as you suggest.

Thanks again
Ernie
by EBrant
Sat Sep 15, 2012 11:59 pm
Forum: Windows PowerShell
Topic: [Parameter(Mandatory=$true)] makes %errorlevel% always return 0
Replies: 2
Views: 842

[Parameter(Mandatory=$true)] makes %errorlevel% always return 0

Hello All :) This is seriously weird if I have a script called Script1.ps1 below Param ($path) trap { "!Error"; exit 3} if (!(Test-Path $path)) {throw "no such path"} and a batch file Call-Script1.ps1 echo %errorlevel% powershell.exe -file ./Script1.ps1 "C:NoSuchDirectory" echo %errorlevel% %errorle...
by EBrant
Sat Sep 15, 2012 11:04 am
Forum: Windows PowerShell
Topic: Setting the DOS %ERRORLEVEL% variable from within PowerShell
Replies: 2
Views: 1988

Setting the DOS %ERRORLEVEL% variable from within PowerShell

Thanks Jim, I will give it another go. PS, would you be interested in doing some paid one-to-one teaching? my company said they may fund this for me i.e. WebEx into my PC/Lab (we have WebEx account). Can pay via paypal for example and claim back on my company expenses. An hour hear and an hour there...
by EBrant
Sat Sep 15, 2012 9:50 am
Forum: Windows PowerShell
Topic: Setting the DOS %ERRORLEVEL% variable from within PowerShell
Replies: 2
Views: 1988

Setting the DOS %ERRORLEVEL% variable from within PowerShell

Hello All :) Can someone please assist with the following question/issue if I have a script C:MyScript.ps1 like this $ErrorActionPreference = "Stop" Trap { "error!"; exit 9} get-process NoSuchProcess The above works as expected if I then create a DOS batch file called Run1.cmd PowerShell.exe -file C...
by EBrant
Wed Sep 12, 2012 9:52 pm
Forum: Windows PowerShell
Topic: Using the OpenWrite() method with a File
Replies: 4
Views: 2308

Using the OpenWrite() method with a File

Thanks very much Jim for your detailed reply, thanks also zxc1029, I appreciate everyones time

Ernie
by EBrant
Wed Sep 12, 2012 1:39 am
Forum: VBScript
Topic: Replacing text in a file
Replies: 2
Views: 2082

Replacing text in a file

Thanks very much Jim, :)
Ernie
by EBrant
Tue Sep 11, 2012 11:32 pm
Forum: VBScript
Topic: Replacing text in a file
Replies: 2
Views: 2082

Replacing text in a file

Hello All :) I have the following little script Const ForReading = 1 Const ForWriting = 2 strDirectoryName = Wscript.Arguments(0) strOldText = Wscript.Arguments(1) strNewText = Wscript.Arguments(2) Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder(strDirectoryN...
by EBrant
Tue Sep 11, 2012 10:42 pm
Forum: Windows PowerShell
Topic: Using the OpenWrite() method with a File
Replies: 4
Views: 2308

Using the OpenWrite() method with a File

Hello, I have a bunch of files in a given directory, I want to open each of the files in turn, search for a given string (i.e a line at a time) and if found replace with another given string. I have done this OK by placing the results into a new file name. However what I want to do is open the orign...
by EBrant
Fri Aug 24, 2012 8:31 am
Forum: Windows PowerShell
Topic: Win32_Share create method
Replies: 1
Views: 898

Win32_Share create method

boa noiteCan you please assist me with the following question, :)if I do this ([wmiclass]'win32_share').methodsI get a list of available methods one of which is the Create method, so if I now do this([wmiclass]'win32_share').GetMethodParameters("create").propertiesI get a list of that parameters and...