Microsoft Azure Powershell error - register-AzureProvider - powershell

Here is the error with --> register-AzureProvider
PS C:\> register-AzureProvider -ProviderNamespace Microsoft.DevTestLab
register-AzureProvider : The term 'register-AzureProvider' 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
+ register-AzureProvider -ProviderNamespace Microsoft.DevTestLab
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (register-AzureProvider:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

If you're using Azure PowerShell Cmdlets version 0.9.8 (or earlier), you will need to do the following first:
Switch-AzureMode AzureResourceManager
Please refer to the documentation on using Using Azure PowerShell with Azure Resource Manager here: https://azure.microsoft.com/en-in/documentation/articles/powershell-azure-resource-manager/.

Related

Commands for launching a replacement instance from an AMI in AWS using powershell

Can you please let me know if there are any powershell commands to launch for launching a replacement instance from an AMI in AWS using powershell?
I tried searching the net and found this command "New-AWSWindowsHelpersReplacementInstance" but when I run this I get an error message:
New-AWSWindowsHelpersReplacementInstance : The term 'New-AWSWindowsHelpersReplacementInstance' 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-AWSWindowsHelpersReplacementInstance -Region eu-west-2 -InstanceI ...
+ CategoryInfo : ObjectNotFound: (New-AWSWindowsHelpersReplacementInstance:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

Powershell `Set-MpPreference` not recognized

On running Set-MpPreference -DisableScriptScanning 1, I'm getting:
The term 'Set-MpPreference' 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-MpPreference -DisableScriptScanning 1
~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Set-MpPreference:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
I've gone through the following threads, but nothing seems to work:
Add-MpPreference is not recognized as a name
Powershell Set-MpPreference -DisableRealtimeMonitoring $true not working
I'm using Powershell v5.1 on Windows 7.
What could the reason be?
Have you tried
Import-Module Defender
I am not sure if the module exists on Windows 7 yet tough...
Use 64bit Powershell:
C:\windows\sysnative\WindowsPowershell\v1.0\powershell.exe

Running Invoke-AzureRmVMRunCommand through Azure automation

I am trying to run a script thorugh Invoke-AzureRmVMRunCommand from azure automation but it is showing cmdlet does not exist. Please let me know how to implement this.
Below the script
Invoke-AzureRMVMRunCommand -ResourceGroup 'XXXXXX' -Name XXXXX-CommandID 'RunPowerShellScript' -ScriptPath 'Test.ps1'
Error details.
Invoke-AzureRMVMRunCommand : The term 'Invoke-AzureRMVMRunCommand' 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
+ Invoke-AzureRMVMRunCommand -ResourceGroup 'olf3em-rds-mgmt' -Name OLF ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Invoke-AzureRMVMRunCommand:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
You need to install modules before using those:
https://learn.microsoft.com/en-us/azure/automation/automation-runbook-gallery#modules-in-powershell-gallery
in short:
go to modules
browse gallery
install
The Invoke-AzureRmVMRunCommand command is included in the AzureRM.Compute module. Which you will first need to install in your Automation Account.

Getting cluster detail of Windows

Is there any other way to get Windows cluster details like cluster & machine info using PowerShell command?
I tried to use Get-Cluster command but it's not working throwing an error.
get-cluster : The term 'get-cluster' 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-cluster
+ ~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (get-cluster:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException

The term is not recognized as the name of a cmdlet in powershell

We have recently installed SharePoint 2013 on Windows Server 2012 R2.
When I am trying to run Enable-SPSessionStateService -DefaultProvision using Windows PowerShell then below error is occuring. What am I missing here?? Please help.
PS C:\Users\sysuser> Enable-SPSessionStateService -DefaultProvision
Enable-SPSessionStateService : The term 'Enable-SPSessionStateService' 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
+ Enable-SPSessionStateService -DefaultProvision
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Enable-SPSessionStateService:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException