|
Comparing two files and making changes
Hi,
I've been banging my head against a wall trying to figure this out and
nothing seems to work.
I have two files, File A contains a bunch of student information and File B
contains email aliases. File A has about 15,000 lines with each line being a
different student. File B has about 50,000 lines with about 49,000 lines
being aliases. The first 1000 lines or so in File B is miscellan...
|
4 |
12/31/2008 3:08:10 AM |
|
UNABLE to delete object using remove-qadobject
Remove-QADObject : The directory service can perform the requested operation
only on a leaf object. (Exception from HRESULT: 0x80
072015)
I am trying to delete an COMPUTER object. and it does not work.
remove-qadobject -identity "mydomain/$computername$"
...
|
1 |
12/31/2008 2:48:47 AM |
|
Adobe parsing project
hello list
i am in waaay over my head, and hope you can straighten me out while i am
trying to learn powershell.
i get a big PDF file from a state office that needs to be parsed and
graphed, but its format is very gnarly because the PDF doesnt leave any
commas or quotes, and has no fixed positions but i think i should be able to
do what i need by testing each character in the pipeline ...
|
6 |
12/31/2008 2:09:29 AM |
|
Playing with the registry
First of all....I`m running CTP3.
The values in the dropdown list with recent URL`s in Internet Explorer (hit
F4) are located in this registrykey: HKCU:\Software\Microsoft\Internet
Explorer\TypedURLs
With PowerShell the registrykeys can be found like this:
PS>Set-Location "HKCU:\Software\Microsoft\Internet Explorer\TypedURLs"
PS>(Get-Item . ).GetValueNames() |Where-Object {$_ -...
|
5 |
12/31/2008 12:28:13 AM |
|
[ctp3] Needs ISE .NET Framework 3.5.1
Hello,
I'm testing V2 CTP 3 in Window Vista Virtual Box.
For unknown reasons .NetFramework 3.5.1 setup has failed repeatedly.
In 'Download details: Windows PowerShell V2 CTP3'
(http://www.microsoft.com/downloads/details.aspx?FamilyID=c913aeab-d7b4-4bb1-a958-ee6d7fe307bc&displaylang=en)
it says that ISE depends on .NetFramework 3.5.1.
My observations are that Out-Grid doesn't work, as announced...
|
6 |
12/31/2008 12:16:56 AM |
|
assigning random creation dates to files
Hallo guys and happy new year to everybody. :D
Sometimes to make tests I need to assign different creation dates
between a specific range to my files. I'm looking for a way to do it
with powershell.
I found this article
'Generate Random Dates in PowerShell « saadware'
(http://blog.saadware.com/2008/06/12/generate-random-dates-in-powershell/)
but i don't know how to apply this code to each fil...
|
6 |
12/30/2008 10:52:18 PM |
|
filter out text..
In this I want to filter out "0 KB" (e.g Those apps whose WS has not
changed in the specified $args [time])...but I am thinking my
construct is not working with objects quite right. Any input is
appreciated.
$then = ps | %{$_ | Select Name, WorkingSet}
sleep $args[0]
$now = ps | %{$_ | Select Name, WorkingSet}
$count = $now.count
$difference = ( 0..$count |
%{"WS diff is" + " " + $No...
|
3 |
12/30/2008 10:48:20 PM |
|
No way to close Excel. Any reason ?
I've a excel spreadsheet that contains computer data on 1st column. AFter
reading all rows and exit, the Excel.exe was not removed from the taskbar.
===================================================================
Add-PsSnapin Quest.ActiveRoles.ADManagement
function release-ref($ref)
{
[System.Runtime.Interopservices.Marshal]::ReleaseComObject($ref)
[system.gc]::collect()
[s...
|
8 |
12/30/2008 10:41:41 PM |
|
Latest restart time and latest installed windows update time to HT
How could i get server names from txt file and put the latest restart time
and latest installed windows update time to HTML file?
I have a script that gets server names from txt file, pings servers and puts
the result (pinging server name with green and not pinging server name with
red) to HTML file. Could it be done similarly?
Here is my current script:
clear
$pingResults =("E:\Pi...
|
6 |
12/30/2008 10:37:59 PM |
|
ping results to html file
I have a list of servers in my MachineList.txt file.
I want to get the result of this script to go to html file.
The idea is to have a ping monitoring html file, where pinging servers are
displayed green and not pinging servers are displayed red.
Here is my script:
Clear
$PingMachines = Gc "C:\MachineList.txt"
ForEach($MachineName In $PingMachines)
{$PingStatus = Gwmi Win32_PingStat...
|
7 |
12/30/2008 6:43:22 PM |
|
CTP3 Posh ISE Intellisense?
Hi,
Probably a stupid question, but now that the ISE is coming along so
well ( what a difference! )
is there any way to get Intellisense or tab completion working in
there. Pretty please....
Thanks,
Stuart
...
|
7 |
12/30/2008 6:09:01 PM |
|
PowerShellHelp.exe
After 45-day trial expired, one is able to view the GUI help content
from PrimalScript 2007. Awesome!...
|
3 |
12/30/2008 6:05:02 PM |
|
CTP3, new cmdlet Start-Process issue
CTP3, new cmdlet Start-Process issue
> Set-Location hkcu:\
> Start-Process notepad
Start-Process : Cannot open file because the current provider
(Microsoft.PowerShell.Core\Registry) cannot open a file.
....
What do you think:
1) it is a bug
2) it is by design because PowerShell (is | will be) able to start
processes "from provider items"
3) other thoughts?...
|
6 |
12/30/2008 3:20:27 PM |
|
variable probleme
Hi
I would like to do this :
$list="get-command","get-service"
foreach ($l in $list)
{
echo $l
foreach($i in $l)
{
$a=$i.name
echo $a
}
}
The probleme is :
The variable in the second foreach ($ l) appears to be seen as a string and
not a command.do anyone have an idea ?
Thanks...
|
4 |
12/30/2008 11:58:01 AM |
|
Graphical Windows PowerShell V2 CTP2
What is the main function of
CompiledComposition.Microsoft.PowerShell.GPowerShell.dll, which is
always located in UserProfile temp folder? Interestingly, without this
library, the program terminates. The file size is about 116KB, and
will be generated by the program if found missing.
Cheers....
|
4 |
12/29/2008 11:10:25 PM |
|
Functions: Taking input from the Pipe
I'm working a lot with Exchange 2007 and when I retrieve an object and format
it with FL I get back a list of properties - but also properties that I'm not
interested in(for example GUID, etc).
So I normaly use SELECT to exclude those properties. However, specifying the
properties ever and ever again is a bit boring...
My idea was to write a function to have the same select command ava...
|
4 |
12/29/2008 10:11:35 PM |
|
[CTP3] CmdletBinding attribute syntax with named functions
What is the right syntax for using CmdletBinding attribute?
PS> get-help about_functions_advanced
....
get-help About_Functions_CmdletBindingAttribute
....
PS> [CmdletBinding] example-foo
Unexpected token 'example-foo' in expression or statement.
At line:1 char:28
+ [CmdletBinding] example-foo <<<<
+ CategoryInfo : ParserError: (example-foo:String) [],
...
|
2 |
12/29/2008 3:00:00 PM |
|
[CTP3] Connect-WSMan locks when target host unavailable
Hi All, long time no post, after installing Powershell V2 CTP3 and testing
with Connect-WSMan I noticed the following issues:
- No full help for Connect-WSMan
- Connect-WSMan locks up when target host is unavailable and SSL transport
used
PS> Connect-WSMan -Computer NONEXISTENT -UseSSL
.... doesn't time-out
Is there some way to have a time-out when Connect-WSMan fails to reach th...
|
1 |
12/29/2008 10:05:17 AM |
|
CTP and Software Restriction Policies
Sis ir vairakdalu zinojums MIME formata.
------=_NextPart_000_0031_01C969A3.0378E490
Content-Type: text/plain;
format=flowed;
charset="Utf-8";
reply-type=original
Content-Transfer-Encoding: 7bit
Yesterday I've installed PowerShell CTP3 on my notebook and found
interesting bug. For virus protection I use Software Restriction Policies
and it blocks PS1 files to load:
Windows Pow...
|
1 |
12/29/2008 8:48:41 AM |
|
V2 script extensions
I always assumed the "1" in ".ps1" referred to the fact that it was
PowerShell v1. But now I see the CTP versions still using .ps1 for
scripts. I figured that .ps1 would continue to run v1 scripts (backward
compatibility), but a new extension, .ps2, would be used so they would
only run in PowerShell v2. So... why not? What's the "1" for?
--
David Trimboli
Windows Systems Analyst
Col...
|
6 |
12/28/2008 11:08:24 PM |
|
Why behaves Join-Path not the pythonic way
I was just surprised to see that
Join-path $pwd $profile
yields
C:\Users\berndk\C:\Users\berndk\Documents\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1
and doesn't recognize that $profile is an absolut path.
I dare say that is an issue.
or tell me a usecase where plain concatination is desired.
Happy scripting
Bernd
--
Bernd K...
|
4 |
12/28/2008 11:04:26 PM |
|
Query userid return cmpuer name
New to PowerShell, new to AD
What I would like to do is enter a users windows ID for a user who is logged
on to a domain and have the computer name returned. Is this possible?
Pointers on how to accomplish this would be welcomed.
...
|
6 |
12/28/2008 3:55:01 PM |
|
CTP3 debug commands greyed out in powershell ISE?
In the powershell ISE, I type in a few commands in the script window or load
a script, and want to step through the code, but all the debug commands are
greyed out and F11 does nothing? What do I need to do to step through code?
...
|
4 |
12/27/2008 8:57:19 PM |
|
[CTP3]how to set Unrestricted ExecutionPolicy
PS C:\> Set-ExecutionPolicy -ExecutionPolicy:Unrestricted -Scope:LocalMachine
Set-ExecutionPolicy : Windows PowerShell updated your execution policy
successfully, but the setting is overridden by a policy defined at a more
specific scope. [/snippet]
from "releaseNotes.rtf" :"Windows PowerShell V2 CTP3 uses the execution
policy setting from the previous installation of Windows PowerS...
|
6 |
12/27/2008 6:57:01 PM |
|
How to make the result of function GLOBAL?
#1,place a Test-LeapYear.ps1 file in current ps path
#2,import-function .\Test-LeapYear.ps1
#3,"Test-LeapYear 2008" will not work
function import-function($pathname)
{
$funName = (Get-Item $pathname).name.split(".")[0]
$funBody = get-content $pathname | out-string
$fun = "function "
$fun += $funName
$fun += "(){`n"
$fun += $funBody
$fun += "`n }"
invoke-Expression $($fu...
|
10 |
12/27/2008 3:18:29 AM |