PowerShell is a command prompt and a scripting environment designed for Windows system administration.

learn more… | top users | synonyms (1)

1
vote
1answer
13 views

How to exit powershell from a sourced script?

Consider "outer.ps1": "in outer.ps1" . .\inner.ps1 "in outer.ps1 after sourcing inner.ps1" that sources "inner.ps1" which just exits: exit 0 When I run "outer.ps1" the output indicates that the ...
1
vote
1answer
12 views

Powershell - Change from .Name property to String

Is this possible? I need to convert from System.DirectoryServices.PropertyValueCollection to a String. i.e. $ou = [ADSI]"LDAP://OU=Domain Controllers,DC=morgansmiths,DC=local" foreach ($child in ...
0
votes
1answer
14 views

Powershell - Working with Arrays

A fairly basic script - searches Ou in AD and exports computers - I want to store each computer into an array so I can loop through later and run some commands against the computers. Although not ...
0
votes
1answer
8 views

Powershell - Test-Connection Return Value

So Test-Connection with the -quiet switch can return a boolean. Now I need to somehow test to see whether that is True or False, then carry out an action dependent on that result. Is that possible? ...
0
votes
1answer
8 views

How to add license files as part of custom NuGet package using PowerShell

I am facing an issue with PowerShell and NuGet. I have created a custom package, which also contains a license file in the lib directory. If I use the following code in an attempt to add a relative ...
1
vote
2answers
20 views

2.0 version of System.Management.Automation?

Is there a 2.0 (or greater) version of the System.Management.Automation assembly? I'm looking at the PowerShell class in C# which says that this class was introduced with PowerShell 2.0. Does that ...
1
vote
2answers
31 views

Best way to assemble a string file in PowerShell

I have a hash/array structure that I want to use to assemble a couple text files. Is this the best way to achieve this? $resolutions = @( @{"bitrate" = 1100; "width" = 1920; "height" = 1080}; ...
0
votes
1answer
27 views

Using Select-String against a server list

I have a serverlist which contains all server names on a single line. Each server has the exact path and file as listed in the following: $Computers = get-content "c:\temp\serverlist.txt" foreach ...
0
votes
0answers
8 views

Update an item property in SharePoint 2007 using stsadm PowerShell

So what I'd like to automate is updating the status of a SharePoint list item. I'd like to execute the script and for it to be able to loop through a page's Name column to evaluate the property of ...
0
votes
1answer
23 views

No PowerShell in System.Management.Automation?

I'm having trouble getting the PowerShell class to resolve. I'm following along with the example in this question. I have a reference added to System.Management.Automation from C:\Program ...
0
votes
2answers
12 views

How to Change name of the NetConnectionProfile Using Set-NetConnectionProfile in PowerShell

I Tried Using How to Change name of the NetConnectionProfile Using Set-NetConnectionProfile $Profile=Get-NetConnectionProfile -InterfaceIndex 35 $Profile.Name = "Network1" The Error ...
0
votes
0answers
15 views

Powershell - Race condition creating and setting exchange objects

What is the best way to avoid the race condition when creating then setting object parameters with PowerShell 2.0 and Exchange 2010? The problem occurs when creating mailboxes and distribution groups ...
0
votes
1answer
29 views

Powershell: Download or Save source code for whole ie page

I have this PS script it logins to a site and then it navigate's to another page. I want to save whole source for that page. but for some reason. some parts of source code is not coming across. ...
0
votes
1answer
15 views

Powershell: cannot call a method on a null-valued expression error

I am trying to login to a website via powershell. Here is PS code $username = "userhere" $password = "passhere" $ie = New-Object -com InternetExplorer.Application $ie.visible=$false ...
0
votes
2answers
27 views

Cannot find property on object that exists

I have an array of objects and am trying to manipulate it and am getting an error that the property RptFile does not exist. I have checked the spelling and everything and am baffled as to what is ...

1 2 3 4 5 695
15 30 50 per page