|
Powershell compatiability
I thought all previous scripts were supposed to be compatible.
Why does:
netstat -an | find "ESTABLISHED" generate an error?
...
|
4 |
03.07.2007 03:35:43 |
|
Reading from Excel
I can find numerous examples of writing information out to a spreadsheet, but
one common task that I do in VBScript is open a spreadsheet and read the
servername out of column A and place the result of whatever I am looking for
in column B. I think that if I had code that would even allow me to read the
information out of cell 1,1 I could figure the rest of it out; here is the
script tha...
|
7 |
02.07.2007 23:56:02 |
|
treesize in powershell?
Hi, is there any script that makes like treesize in Powershell ?
bye
Nico
...
|
2 |
02.07.2007 23:15:06 |
|
Any analog of "less" filter?
Is it possible to scroll up output text using keyboard, similar to unix
"less" filter?...
|
5 |
02.07.2007 21:53:58 |
|
Guaranteed cleanup of .NET objects that implement IDisposable (e.g. C#'s "using")
Hi there,
Sometimes I find myself using .NET objects that implement IDisposable
in my PowerShell scripts. I'd like to be able to have the Dispose()
method called when they go out of scope (regardless of whether the
scope is exited because of an exception). I'd also like to be covered
in the case of a Ctrl-C abort too. And I'd like it to be terse enough
to use in one-off command-line script...
|
1 |
02.07.2007 21:04:39 |
|
Search for string in CSV and delete line if string found in line
Hi, don't really know where to start with this one! I've run a report
finding all PST files on our network, however, i have a lot of
duplicates where the report has pulled multiple paths for each PST
file... this is due to admin share paths as well as normal share
filepaths.
For example:
\\servername\f$\username\pstfilename
\\servername\sharename\pstfilename
\\servername\username$\pstfi...
|
3 |
02.07.2007 20:42:54 |
|
VBScript vs. PowerShell error handling
I'm still a little confused by error handling in PowerShell. In
VBScript I would identify the likely error conditions and then script
around them. For example, I map a drive and check errors. If the error
is that there is already a drive mapped, then I unmap the remembered
connection and try again. Drive mapping is just an example, but I'd
like to know how to deal with this in general.
The...
|
4 |
02.07.2007 17:26:08 |
|
Call powershell script via Batch-File
Hi everyone,
i wrote a script to sign my powershell scripts. When I call the sign
script with a file to sign any file, the script works fine. But when I
create a batch file to call the powershell script with a file to sign,
I get the error message that no file name was given.
Batch-File:
..\SignFile.ps1 %1%
SignFile.ps1:
Param
(
[string] $File
)
$str = "Filename: " + $File
W...
|
3 |
02.07.2007 15:50:01 |
|
PowerGadgets on x64
Have any of you had any issues running powergadgets on x64 Vista.
Everytime I run the x64 installer I get. "Windows Powershell is Required"
YES... I have powershell x64 installed :)
--
Brandon Shell
---------------
Stop by my blog some time :)
Blog: http://www.bsonposh.com/
PSH Scripts Project: www.codeplex.com/psobject
--------------------------------------
...
|
3 |
02.07.2007 13:53:52 |
|
File locking
I need to run a nightly job that will delete all files in a directory. There
are about 50,000 plus files (some locked) that have to be deleted every
night. What i need to know is if there is a way to unlock files via pwshell
to delete them. Also this needs to be done with out killing the servers
resources.
Thanks...
|
2 |
02.07.2007 11:23:26 |
|
How to submit page
I my application we have used master page.So the form id for each page is
same("aspnetForm").By using this id I can't able to save the data....
|
1 |
02.07.2007 09:54:01 |
|
how to know who is the user connected to a specific computer ?
Hi everybody, how could i know which user is connected at the moment on a
specific machine ?
I think the WMI could be a solution, but i don't know how to make it
function, and i think they are some other better solutions.
please help me
bye
Nico
...
|
4 |
01.07.2007 16:03:17 |
|
free powergadgets ?
Hi everybody, do some free powershell gadgets exist on the net ?
do you know some ?
bye
Nico
...
|
4 |
01.07.2007 14:28:35 |
|
invoke-expression not appending
Hi,
I have a situation where when I use invoke-expression, I cannot output to a
file. It just outputs to the console but when I run the command, it does
output to a file. I pipe the output to out-file filename -append. , ie.
$testfile= file.txt
$cmd = "rmtshare \\testserver\share1"
invoke-expression $cmd | out-file $testfile -append
although it works when I do:
$testfile = fi...
|
4 |
30.06.2007 09:44:17 |
|
IDEA: scriptmethod "method overload" (and functions too)
one thing is that scriptmethods can't have overloads in powershell
like they can in otherlanguages, actually they can't even have
strongly typed parameters so that argument is moot. However i added
them in the previous example. This technique can also be applied as
easily to functions.
anyhow an example..
$a = "whatever"
$a = add-member -inputobject $a -membertype scriptmethod -name
...
|
1 |
30.06.2007 07:29:31 |
|
IDEA: Strongly typed scriptmethods
akin to the previous post about scriptproperties, i've extended this
for scriptmethods.. One of the thing that irked me about script
methods, is that you couldn't have strongly typed parameters,
basically all the params just came through in the $args
so while in C# you could do
string repeattext ( string text, int times)
or even a powershell function you could do
function repeattext...
|
1 |
30.06.2007 05:49:01 |
|
you can not call a method on null-valued expression
I am trying to enable click event(submit button) in my aspx page.I have
written the following code.
$ie.document.getelementbyid("SubmitCreds").submit()
It is giving error(you can not call a method on null-valued
expression).Please help me.
...
|
5 |
29.06.2007 19:27:22 |
|
How to enter values in web page
I know how to open Internet explorer.I want to add values webpage.
Example: I have opened my mail and I want to insert my userid and
passwords and press enterautomatically. ...
|
5 |
29.06.2007 18:00:04 |
|
Execute scripts in current scope?
I think i'm missing something big. I'm hoping that the answer is simple, if
not I'm going to be very dismayed with powershell.
I want to run scripts that setup my current working environment with
variables, objects and functions. This way I can start a new power-shell,
run a script and be at a useful state immediately.
In the most simplest form, i want to run this "goodbye.ps1" s...
|
4 |
29.06.2007 17:36:03 |
|
Simple one - modify app's commandline arguments dynamically
I want to write a small script that will basically run a command line
backup. the command i have is:
stsadm -o export -url http://radportal -filename backup -includeusersecurity
i want to append the date to "backup" so that the filename of the backup is,
for example, backup062807
I found how to get the date info but im a little confused as to how to add
that in and then how to execu...
|
5 |
29.06.2007 16:15:48 |
|
Gotcha: unexpected -or and -and precedence
This result looks unexpected to me:
PS> $true -or $true -and $false
False
Does that mean that -or and -and have the same precedence, so that parens
*must* be used for this:
PS> $true -or ($true -and $false)
True
--
Thanks,
Roman Kuzmin
...
|
10 |
29.06.2007 16:04:06 |
|
Powershell and Logon Scripts
Over the months, i've heard alot of people talk about the issue with
powershell and logon scripts, and no support for it.
I'd like to get those complaints in one area, as i'm thinking of
various workarounds, and also get some ideas of what people would
like, if they could run powershell in a startup script.
to me the biggest problem is the fact that PS isn't on all systems,
and you can't...
|
3 |
29.06.2007 14:05:47 |
|
Get-Window CmdLet
Hi All,
A couple of weeks ago I was at session presented by Bruce Payette. He
showed some tricks with a snapin he downloaded called get-window. He used
it to manipulate the calculator window (change caption, hide buttons,
etc...)
I have been looking on the net to find this snapin, I found this one wich
has the same name but i am not convinced that this is it...
http://blogs.msdn...
|
2 |
29.06.2007 11:40:07 |
|
Invoke .Net application
Can I invoke .net application using powershell...
|
5 |
29.06.2007 10:24:03 |
|
Executing batch files in PS scripts
I am have a trouble writing a PowerShell wrapper around some batch files. I
have a wrapper working using WScript/VBScript but I would like to move to
PowerShell.
The working WScript/VBScript code echos 'y' into a make.bat prompt. CODE 123
VER 1.2.3 are parameters for make.bat and I'm redirecting stderr to stdout.
Stdout is dumped into a log file (and monitored for errors, code not shown...
|
6 |
29.06.2007 01:52:01 |