'New-SelfSignedCertificate' is not recognised as the name of a cmdlet [duplicate] - powershell

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

Related

PowerShell does not recognize the command Resolve-DnsName

Error on power shell script,
Import-Module DnsClient
Import-Module : The specified module 'DnsClient' was not loaded because no
valid module file was found in any module directory.
At line:1 char:1
+ Import-Module DnsClient
+ ~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (DnsClient:String) [Import-Module], FileNotFoundException
+ FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand
Resolve-DnsName
Resolve-DnsName : The term 'Resolve-DnsName' 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
+ Resolve-DnsName
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Resolve-DnsName:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
PS C:\Users\aquib> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
2 0 -1 -1
Resolve-DnsName is one of the commands added in Windows 8/Windows 2012 and later. By design, it is not available on versions of Windows prior to that regardless of which version of PowerShell you use. The command is unavailable on Windows 7 and Windows 2008 R2 and earlier. Most sources I've read say that the underlying WinAPI functions that the command depends upon were added in Windows 8/2012.
I would recommend using [System.Net.Dns]::GetHostEntry($HostnameOrIP) or one of the other non-obsolete static methods in that class. However, that only works for A, AAAA, and PTR records, and there isn't a class in the .Net Framework CLR for generic DNS requests. You'd have to roll your own or use a third-party library like ARSoft.Tools.Net.

Cloudberry powershell snapin no longer working

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.

The term 'Set-AzureKeyVaultKeyAttributes' is not recognized as the name of a cmdlet,

On my Windows 10 I've Powershell 5.0 installed. But when I run the following command on it, I get the above error.
PS command:
Set-AzureKeyVaultKeyAttributes -Name Key2 -VaultName KayVault-abctest -Enable $false
Error
Set-AzureKeyVaultKeyAttributes : The term 'Set-AzureKeyVaultKeyAttributes' 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
+ Set-AzureKeyVaultKeyAttributes -Name Key2 -VaultName KayVault-abctest ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Set-AzureKeyVaultKeyAttributes:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Note
I'm using the topic Create a Key (Portal) in this official Azure lab tutorial.
I believe the name of the cmdlet should be the singular Set-AzureKeyVaultKeyAttribute, rather than the plural Set-AzureKeyVaultKeyAttributes. Note that this is one of the Strongly Encouraged Development Guidelines for Powershell by Microsoft:
To enhance the user experience, the noun that you choose for a cmdlet name should be singular. For example, use the name Get-Process instead of Get-Processes. It is best to follow this rule for all cmdlet names, even when a cmdlet is likely to act upon more than one item.
If you are still seeing the same problem while using a singular name, ensure that the AzureRM.KeyVault module is installed and loaded:
Install-Module AzureRM.KeyVault
Import-Module AzureRM.KeyVault

Powershell: can't access MSMQ Cmdlets

I'd like to use the Message Queueing (MSMQ) Cmdlets Message Queueing (MSMQ) Cmdlets but they all show as unavailable:
PS C:\users\admin\Desktop> Get-MsmqQueue
Get-MsmqQueue : The term 'Get-MsmqQueue' 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
+ Get-MsmqQueue
+ ~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-MsmqQueue:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I have Windows 8.1 and PowerShell 4 running as administrator
PS C:\users\admin\Desktop> $PSVersionTable.PSVersion
Major Minor Build Revision
----- ----- ----- --------
4 0 -1 -1
According to OP's comment, MSMQ features were not installed :
I just assumed the machine I was on had MSMQ already but it turned out it didn't.
See this question for instructions on how to install them with PowerShell

psexec not recognized

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