cmdlets

Get a list of all Resources in my Azure Subscription (Powershell Preferably)

*爱你&永不变心* 提交于 2019-11-26 23:36:29
问题 I have an azure subscription and I'm trying to write a powershell script to automatically get a list of all the resources (VMs, Storage Accounts, Databases, etc) that I currently have in my subscription. Is there a way to do this using the azure management REST API or the Azure Cmdlets? 回答1: If you are using the new Resource Manager model (introduced in 2014) you can use the following PowerShell script. Login-AzureRmAccount Get-AzureRmResource | Export-Csv "c:\Azure Resources.csv" To use the

MSOnline can't be imported on PowerShell (Connect-MsolService error)

一个人想着一个人 提交于 2019-11-26 16:03:40
问题 I had this issue and couldn´t find any answer. The issue was that I was trying to use Azure cdmlets to connect to O365 via c# code, but I couldn´t get the connect-msolservice . ""The term is not recognized" error when you try to run administrative Windows PowerShell cmdlets in Office 365" 回答1: After reviewing Microsoft's TechNet article "Azure Active Directory Cmdlets" -> section "Install the Azure AD Module", it seems that this process has been drastically simplified, thankfully. As of 2016

For PowerShell cmdlets, can I always pass a script block to a string parameter?

情到浓时终转凉″ 提交于 2019-11-26 11:37:05
问题 I\'m looking at the document of Rename-Item and there is an example like this. PS C:\\>Get-ChildItem *.txt | Rename-Item -NewName { $_.name -Replace \'\\.txt\',\'.log\' } This example shows how to use the Replace operator to rename multiple files, even though the NewName parameter does not accept wildcard characters. This command renames all of the .txt files in the current directory to .log. The command uses the Get-ChildItem cmdlet to get all of the files in the current folder that have a