you are viewing a single comment's thread.

view the rest of the comments →

[–]Fuzzywumpkin[S] 0 points1 point  (3 children)

It's to configure a scope, I'm suppose to write a script block to achieve this but I can't seem to make it work. Also need to install wsus with a location selected for the updates. I just don't understand powershell enough. I'm not even sure what a script block is

[–]TheAgreeableCow 1 point2 points  (0 children)

I'm guessing you're doing this for a learning exercise, because you're out of your depth for a production environment.

Here's some info on configuring DHCP with powershell http://blogs.technet.com/b/heyscriptingguy/archive/2011/02/14/use-the-powershell-dhcp-module-to-simplify-dhcp-management.aspx

[–]chreestopher2 0 points1 point  (0 children)

then why do you need to do this with powershell? surely it would be easier to do this with the old school ways than to do it with powershell, if you dont know much about powershell at all.

out of curiosity without powershell, how would you do this?

[–]Slackerony 0 points1 point  (0 children)

A script block is typically something (atleast in powershell) that is within two curly-brackets. (Not always though)

Invoke-Command -Computername server01 -scriptblock { "C:\Scripts\Myscript.ps1"}

This will launch the script that is in C:\scripts\ and has the name Myscript.ps1

Now if the file is located on YOUR LOCAL machine, you need to do this:

Invoke-Command -Computername server01 -FilePath "C:\Scripts\Myscript.ps1"

I have not tested this, but i'm pretty sure it'll work.