windows - Powershell script to change the Recycling Time on Application Pool -


I think I need to use that code, but the thing is that not working. >

  Import-Module WebAdministration $ AppPools = Get-ChildItem "IIS: \ AppPools \ Application Pool set ItemProperty -Path $ AppPools -nam recycling.periodicRestart.time -Value 1.00: 00: 00  

but I'm getting this error

  set ItemProperty: could not find path 'C: \ SysWOW64 \ WindowsPowerShell \ v1.0 \ modules \ WebAdministration \ Windows \ Microsoft .IIs.PowerShell.Framework.NodeCollection 'because it does not exist on line: 3 char: 1 + set ItemProperty -Path $ AppPools -nam recycling.periodicRestart.time -Value 1.0 ... + ~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo: ObjectNotFound: ( Minister: \ Windows \ SysW .... NodeCollection: String) [set ItemProperty], ItemNotFoundException + FullyQualifiedErrorId: PathNotFound, Microsoft.PowerShell.Commands.SetItemPropertyCommand  

I know that this is a path The problem is not it works.

  Set-item property-path 'D: \ test \ testps \ new text .txt' -name isReadOnly -value $ true  

any help It is great ...

this is is a path issue

object Get-ChildItem 'IIS: \ AppPools \ App Pool' is returned from a node Collection object, and when you set -ItemProperty -Path $ AppPools is expanded to , $ AppPools "Microsoft.IIs.PowerShell.Framework.NodeCollection" (which is not a valid path)

To do Application to change the properties of the pool:

  set ItemProperty -Path "IIS: \ AppPools \ Application Pool -nam recycling.periodicRestart.time -Value 1.00: 00: 00  

Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -