How to run this script...

Apr 16, 2013 at 12:49 PM
Hello guys..... i am not able to run this script... earlier i use to run .ps1 extension files... but i dont know how run .psm1 and .psd1 files.... to get the GUI interface of this script.... please help me with the steps to run this...

Vinay
Apr 16, 2013 at 1:29 PM
Edited Apr 16, 2013 at 1:29 PM
Ivan, Hi. Do you know how to use powershell module?
This tool isn't have a GUI interface. You need to put PoshWsus folder in to
%userprofile%\Documents\WindowsPowerShell\Modules\
If folders WindowsPowerShell and Modules dosen't exist you need to create them. Than run Powershell console and make:
import-module poshwsus
P.S. Do you speek Russian?
Apr 16, 2013 at 1:56 PM
Ok... it was not created.. then i created give path...

but when i run Import-module poshwsus command then it gives me some error...... how to go for this.


I dont know Russian... only English i knows..

Vina
Apr 17, 2013 at 6:23 AM
Do you copy module foler in to Modules folder?
Show me your output of command:
Get-Module -ListAvailable
if module PoshWSUS exist in list write me an error what you got
Apr 17, 2013 at 6:50 AM
Hi .. Yes Poshwsus module is showing there.. and below is the error which i m getting.

PS C:\Users\vinay.pratap\Documents\WindowsPowerShell\Modules\poshwsus\PoshWSUS2> import-module poshwsus
Import-Module : The assembly 'Microsoft.UpdateServices.Administration' was not loaded because no assembly was found. Pl
ease check the assembly name and try again.
At line:1 char:14
  • import-module <<<< poshwsus
    • CategoryInfo : InvalidOperation: (:) [Import-Module], DllNotFoundException
    • FullyQualifiedErrorId : FormatXmlUpateException,Microsoft.PowerShell.Commands.ImportModuleCommand
Apr 17, 2013 at 7:46 AM
You problem in that the path to module folder is not valid.
C:\Users\vinay.pratap\Documents\WindowsPowerShell\Modules\poshwsus\PoshWSUS2
This is my path to PoshWSUS module folder:
C:\Users\dubinsky.e.g\Documents\WindowsPowerShell\Modules\PoshWSUS
and it contains module files:
Image

Try to replace your module file to folder called PoshWSUS. And after, try this
Get-Module -ListAvailable | where {$_.Name -like "PoshWSUS"}
Image
First result is good.
Second result is because module doesn't exist. And you need to more help... Think that all.
Apr 17, 2013 at 8:40 AM
Hi....

I get below result now, please let me know how to proceed further and make if functional


PS C:\Users\vinay.pratap\Documents\WindowsPowerShell\Modules\poshwsus> Get-Module -ListAvailable

ModuleType Name ExportedCommands

Manifest poshwsus {}
Manifest ActiveDirectory {}
Manifest AppLocker {}
Manifest BitsTransfer {}
Manifest PSDiagnostics {}
Manifest TroubleshootingPack {}


PS C:\Users\vinay.pratap\Documents\WindowsPowerShell\Modules\poshwsus> Get-Module -ListAvailable | where {$_.Name -like
"PoshWSUS"}

ModuleType Name ExportedCommands

Manifest poshwsus {}
Apr 17, 2013 at 10:17 AM
Now you can do
import-module PoshWSUS
Than Get-PoshWSUSCommand and work with this module.
For more information you can reed this and this
Apr 17, 2013 at 10:20 AM
Getting below error while running this command..


PS C:\Users\vinay.pratap\Documents\WindowsPowerShell\Modules\poshwsus> import-module PoshWSUS
Import-Module : The assembly 'Microsoft.UpdateServices.Administration' was not loaded because no assembly was found. Pl
ease check the assembly name and try again.
At line:1 char:14
  • import-module <<<< PoshWSUS
    • CategoryInfo : InvalidOperation: (:) [Import-Module], DllNotFoundException
    • FullyQualifiedErrorId : FormatXmlUpateException,Microsoft.PowerShell.Commands.ImportModuleCommand
Apr 17, 2013 at 11:21 AM
Did you have an installed wsus console on your server? this is very important option.
Apr 17, 2013 at 12:56 PM
Thanks for all kind replies.. its really very usefull for me.... one more thing i wanted to know that is there need to put Psexec.exe in that folder ... is it required. ?
Apr 17, 2013 at 1:27 PM
Also i am getting below error while running command.

PS C:\Documents and Settings\administrator\My Documents\WindowsPowerShell\Modules\poshwsus> import-module PoshWSUS

Security Warning
Run only scripts that you trust. While scripts from the Internet can be useful, this script can potentially harm your
computer. Do you want to run C:\Documents and Settings\Administrator\My
Documents\WindowsPowerShell\Modules\PoshWSUS\TypeData\PoshWSUS.Types.ps1xml?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): r
Import-Module : The following error occurred while loading the extended type data file:
Microsoft.PowerShell, C:\Documents and Settings\Administrator\My Documents\WindowsPowerShell\Modules\PoshWSUS\TypeData\
PoshWSUS.Types.ps1xml : File skipped because it was already present from "Microsoft.PowerShell".
At line:1 char:14
  • import-module <<<< PoshWSUS
    • CategoryInfo : InvalidOperation: (:) [Import-Module], RuntimeException
    • FullyQualifiedErrorId : FormatXmlUpateException,Microsoft.PowerShell.Commands.ImportModuleCommand
Apr 17, 2013 at 1:28 PM
Edited Apr 17, 2013 at 1:35 PM
You need to learn how to use powershell, my friend.

This module only for administering wsus servers. Psexec.exe needed to PoshPiag. This is not related tools.

for resolving your next problem try:
Get-ExecutionPolicy
if the result - restricted. Try
Set-ExecutionPolicy RemoteSigned
Apr 18, 2013 at 11:14 AM
Dear..... i already have give unrestricted permission to powershell but even after this i am getting error. please have a alook in below screen and errors.

PS C:\Documents and Settings\Administrator\My Documents\WindowsPowerShell\Modules\poshwsus> Get-ExecutionPolicy
Unrestricted
PS C:\Documents and Settings\Administrator\My Documents\WindowsPowerShell\Modules\poshwsus>
Apr 18, 2013 at 1:54 PM
Dear... Pls, show me output of this:
dir variable:
Apr 19, 2013 at 12:59 PM
This time when i am running import-module poshwsus command i am getting below output and after pressing R it keep on asking for next command.... i am not getting how it will run... will it give any GUI... or how it will run...

PS C:\Documents and Settings\Administrator\My Documents\WindowsPowerShell\Modules\poshwsus> import-module PoshWSUS

Security Warning
Run only scripts that you trust. While scripts from the Internet can be useful, this script can potentially harm your
computer. Do you want to run C:\Documents and Settings\Administrator\My
Documents\WindowsPowerShell\Modules\PoshWSUS\TypeData\PoshWSUS.Types.ps1xml?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): r

Security Warning
Run only scripts that you trust. While scripts from the Internet can be useful, this script can potentially harm your
computer. Do you want to run C:\Documents and Settings\Administrator\My
Documents\WindowsPowerShell\Modules\PoshWSUS\TypeData\PoshWSUS.Format.ps1xml?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"):
Apr 19, 2013 at 4:40 PM
Read this
Apr 22, 2013 at 12:51 PM
Its not like that..... i am able to run the script and commands...but i dont know how to work on them...as i am getting below output when i run any commands mentioned under script folder... should i run these commands specificaly or is there any way to get its GUI.... so that i can work in better way.


PS C:\Documents and Settings\Administrator\My Documents\WindowsPowerShell\Modules\poshwsus\Scripts> .\Get-PoshWSUSClient
.ps1

Security Warning
Run only scripts that you trust. While scripts from the Internet can be useful, this script can potentially harm your
computer. Do you want to run C:\Documents and Settings\Administrator\My
Documents\WindowsPowerShell\Modules\poshwsus\Scripts\Get-PoshWSUSClient.ps1?
[D] Do not run [R] Run once [S] Suspend [?] Help (default is "D"): r
PS C:\Documents and Settings\Administrator\My Documents\WindowsPowerShell\Modules\poshwsus\Scripts>
Apr 22, 2013 at 2:03 PM
This tool isn't have a GUI interface. This module provides work only with shell and nothing more. Only console. Only hardcore.

To understand how work with this tool you may read This, This, This and This topics. :)) have FUN.
May 3, 2013 at 6:38 AM
C:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe -NoExit -ImportSystemModules