Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PROBLEM ASSIGNING A RETURNED VALUE TO A VARIABLE

Status
Not open for further replies.

mzachen

Programmer
Jul 1, 2011
1
US
Here is my problem...

This code:

import-module WebAdministration
Get-WebAppPoolState AppPoolName

Produces the following output:

Value
-----
Stopped


But this code:

import-module WebAdministration
$state = Get-WebAppPoolState AppPoolName
WRITE-HOST $state

Produces this output:

Microsoft.IIs.PowerShell.Framework.CodeProperty


When I get the state of the App Pool using Get-WebAppPoolState, I need a boolean value of some sort to assign to the variable so I can use it in a conditional statement. I cant use the Microsoft.IIs.PowerShell.Framework.CodeProperty line. How do I correct this? Please help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top