Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何隐藏Azure powershell命令的警告_Powershell_Azure_Azure Storage_Azure Powershell - Fatal编程技术网

如何隐藏Azure powershell命令的警告

如何隐藏Azure powershell命令的警告,powershell,azure,azure-storage,azure-powershell,Powershell,Azure,Azure Storage,Azure Powershell,我在调用某些azure Commandlet时收到警告。 例如: 警告:在Azure PowerShell的未来版本中,GeorgeApplicationEnabled属性将被弃用。该值将合并到AccountType属性中 请注意:我一直在使用$verbose:False来避免调用中出现此类消息。但无法阻止此警告出现。您可以尝试-WarningAction Ignore,但如果不起作用,您可以将警告流(即流3)重定向到$null(或任何您想要的位置): 新建AzureStorageAccount

我在调用某些azure Commandlet时收到警告。 例如:

警告:在Azure PowerShell的未来版本中,GeorgeApplicationEnabled属性将被弃用。该值将合并到AccountType属性中


请注意:我一直在使用$verbose:False来避免调用中出现此类消息。但无法阻止此警告出现。

您可以尝试
-WarningAction Ignore
,但如果不起作用,您可以将警告流(即流3)重定向到
$null
(或任何您想要的位置):

新建AzureStorageAccount-StorageAccountName$storageName 3>$null
#为了可读性,省略了其他参数
请注意,
-Verbose:$false
将影响冗余消息,而不是警告,它们是不同的流

还请注意,这需要Powershell 3+:

所有(*)、警告(3)、详细(4)和调试(5)重定向 引入了操作员 在Windows PowerShell 3.0中。它们在早期版本的Windows PowerShell中不起作用


我以前遇到过完全相同的问题,通过以下方法解决此问题:

New-AzureStorageAccount ... | Out-Null

谢谢但是如何把它变成可读的形式。是否有一些内置变量来获取3(警告流)。对于初学者来说,3>$null将是新的且难以理解的!请让我知道这是否有意义。我不确定我是否理解你关于将其以可读形式呈现的要求。只需附上一条评论,解释我对@PradebbanRaja的回复是什么意思
New-AzureStorageAccount ... | Out-Null