After the recent Windows 10 update my powershell scripts that use the cloudberry snapin are no longer working. I've re-installed cloudberry already with no success.
Even though the snapin is showing as registered:
PS C:\> Get-PSsnapin -Registered
Name : CloudBerryLab.Explorer.PSSnapIn
PSVersion : 2.0
Description : CloudBerry Explorer snap-in for PowerShell
Powershell can't recognize the command:
PS C:\> $destination = Get-CloudFilesystemConnection | Select-CloudFolder
"\\diskstation\drive1\backups\ow-data\"
Get-CloudFilesystemConnection : The term 'Get-CloudFilesystemConnection' is
not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name,
or if a path was included, verify that the
path is correct and try again.
At line:1 char:16
+ $destination = Get-CloudFilesystemConnection | Select-CloudFolder "\\ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-
CloudFilesystemConnection:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
The snapin is also being added to the current session but still doesn't show:
PS C:\> Add-PSSnapin CloudBerryLab.Explorer.PSSnapIn
PS C:\> Get-PSsnapin
Name : Microsoft.PowerShell.Core
PSVersion : 5.1.17134.81
Description : This Windows PowerShell snap-in contains cmdlets used to
manage components of Windows PowerShell.
Ended up doing a re-pave (via "reset") to Win10 and spent the day reinstalling apps. The first app to install after the reset was Cloudberry and the plugin worked fine. The O/S was admittedly a bit old in the teeth having been upgraded from 7 a couple years ago. Thanks for your help attempts.
Related
On a Windows 7 Professional system, it seems not possible to run New-SelfSignedCertificate. I could on a Windows 10 system.
Yes, the shell was started with "Run As Administrator."
PS C:\> new-selfsignedcertificate
new-selfsignedcertificate : The term 'new-selfsignedcertificate' is not recognized as the name of a cmdlet,
function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that
the path is correct and try again.
At line:1 char:1
+ new-selfsignedcertificate
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (new-selfsignedcertificate:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
5 0 10586 117
As stated in the comments above, this isn't available in Windows 7.
However, if you're looking for something with a similar API and capability, then I have used & can recommend this from Microsoft Script Centre:
https://gallery.technet.microsoft.com/scriptcenter/self-signed-certificate-5920a7c6
Have to install AzureRM module to use azure commands through powershell. You can use below command to do it.
Install-Module -Name AzureRM -AllowClobber
I am trying to install psget on windows 10 from powershell in admin mode but I get:
PS C:\Windows\system32> (new-object Net.WebClient).DownloadString("http://psget.net/GetPsGet.ps1") | iex
Downloading PsGet from https://github.com/psget/psget/raw/master/PsGet/PsGet.psm1
Invoke-WebRequest : The given path's format is not supported.
At line:42 char:13
+ Invoke-WebRequest -Uri $Url -OutFile $SaveToLocation
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotImplemented: (:) [Invoke-WebRequest], NotSupportedException
+ FullyQualifiedErrorId : WebCmdletIEDomNotSupportedException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand
Import-Module : The specified module 'C:\Users\myuser\Documents\WindowsPowerShell\Modules C:\Users\myuser\Documents\WindowsPowerShell\Modules\PsGet' was not loaded
because no valid module file was found in any module directory.
At line:105 char:9
+ Import-Module -Name $Destination\PsGet
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (C:\Users\myuser\Do...l\Modules\PsGet:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
PsGet is installed and ready to use
USAGE:
PS> import-module PsGet
PS> install-module PsUrl
For more details:
get-help install-module
Or visit http://psget.net
PS C:\Windows\system32>
As suggested below PsGet is actually already installed on windows 10. I have then continued with the next step:
and as can be seen it installs successfully (needs to be done running as administrator). After a restart of the powershell console I still don't get any color highlighting though:
Any ideas?
Btw: the folder C:\Users[my-user]\Documents\WindowsPowerShell\Modules is empty:
Um... psget as in PowerShellGet module that I am almost certain comes on Win 10. I believe your error is even telling you that. Where it says PsGet is installed and ready to use.
Looks like the script at http://psget.net/GetPsGet.ps1 tries to decide where to install by querying for #($env:PSModulePath -split ';') and then limit the search for paths under Documents\WindowsPowerShell\Modules.
It appears that in your computer, PSModulePath includes twice the folder C:\Users\myuser\Documents\WindowsPowerShell\Modules, which causes an issue with the installation script.
You can do either one of these two options to solve it:
Remove one instance of C:\Users\myuser\Documents\WindowsPowerShell\Modules from the PSModulePath variable.
Install PsGet manually using the instructions in the official website.
I apologize if this is a NOOB question but I wrote a PowerShell script on my windows 10 box and I am trying to run the script on a 2008 box. On the new install of the 2008 box I had to add the windows powershell feature. My end goal is to install the Web Server (IIS) Administration Cmdlets
PS C:\Users\Administrator> Get-Module -ListAvailable | Import-Module
PS C:\Users\Administrator> Get-Module -ListAvailable
ModuleType Name ExportedCommands
---------- ---- ----------------
Manifest BitsTransfer {}
Manifest PSDiagnostics {Enable-PSTrace, Enable-WSManTrace, Start-Trace, Disable-PSWSManCombined...
PS C:\Users\Administrator>
PS C:\Users\Administrator> add-pssnapin WebAdministration
Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 2.
At line:1 char:13
+ add-pssnapin <<<< WebAdministration
+ CategoryInfo : InvalidArgument: (WebAdministration:String) [Add-PSSnapin], PSArgumentException
+ FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand
PS C:\Users\Administrator>
PS C:\Users\Administrator> Import-Module WebAdministration
Import-Module : The specified module 'WebAdministration' was not loaded because no valid module file was found in any module directory.
At line:1 char:14
+ Import-Module <<<< WebAdministration
+ CategoryInfo : ResourceUnavailable: (WebAdministration:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId :Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
Any ideas?
You need to install the IIS managment tools before the WebAdministration-module is available. Try (tested on Win10):
Enable-WindowsOptionalFeature -Online -FeatureName "IIS-WebServerManagementTools" -All
Windows Server 2008 doesn't come with a PowerShell module for managing IIS. That feature was added with Windows Server 2008 R2. You need to download and install it first. See here for further information. See also this related question.
I am working on a Microsoft Server 2008 machine. For some reason, the command "psexec" is not working from powershell on this 1 machine.
When I try to run it I get this:
PS C:\> psexec
The term 'psexec' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or
if a path was included, verify that the path is correct and try again.
At line:1 char:7
+ psexec <<<<
+ CategoryInfo : ObjectNotFound: (psexec:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\>
It is running powershell 2.0. I found this out by doing:
PS C:\> $Host.Version
Major Minor Build Revision
----- ----- ----- --------
2 0 -1 -1
PS C:\>
Any thoughts? I need this command and I'd really prefer not to use a "work around".
Completing the Answer:
You must need to download PSEXEC from the link below and keep in path the launch from Powershell or any Command prompt:
http://technet.microsoft.com/en-us/sysinternals/bb897553
I'm starting out with Powershell, and I'm having a strange error that I can't find much details about with our friend Mr. Google.
And before you ask, yes, I am definitely running Powershell as an Administrator.
I created a simple Cmdlet that counts files of a specified extension in the current directory.
I can build and run installutil fine.
I can see the snap-in when I Call Get-PSSnapin -Registered, and I can add it using Add-PSSnapin
But when I run my cmdlet, I get the following error:
PS C:\work\Enterprise> Get-PSSnapin -Registered
Name : FileCountCmdlet
PSVersion : 2.0
Description : Returns a file count
PS C:\work\> Add-PSSnapin FileCountCmdlet
PS C:\work\> Get-FileCount
Get-FileCount : Access to the path 'C:\Users\{My-User-Name}\Templates' is denied.
At line:1 char:14
+ Get-FileCount <<<<
+ CategoryInfo : NotSpecified: (:) [Get-FileCount], UnauthorizedAccessException
+ FullyQualifiedErrorId : System.UnauthorizedAccessException,FileCount.FileCountCmdlet
Any thoughts or help would be greatly appreciated!
It sounds like you might be running into what this link describes:
Junction Points
http://www.svrops.com/svrops/articles/jpoints.htm
If so, you'll need to update your cmdlet to skip over these junction points.