![](/img/trans.png)
[英]How do I check if user 'IIS AppPool\MyAppPoolName' exists in powershell
[英]Powershell Check MIME exists in IIS
我有以下命令使用PowerShell
向IIS
添加MIME
類型
add-webconfigurationproperty //staticContent -name collection -value @{fileExtension='.xpa'; mimeType='application/octet-stream'}
在調用add-webconfigurationproperty
之前,如何檢查MIME類型是否存在?
您可以查看以下內容:
if( !((Get-WebConfiguration //staticcontent).collection | ? {$_.fileextension -eq '.xpa'}) ) {
#do something
}
您還可以使用以下方法檢查是否存在“屬性”:
if (!(Get-WebConfigurationProperty //staticContent -Name collection[fileExtension=".xpa"]))
{
Write-Host ".xpa doesn't exist"
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.