小编Ada*_*mon的帖子

在命令行中找不到但在 ISE 中可用的 Cmdlet

我正在尝试在 Windows Server 2008 R2 VM 上使用 PowerShell 创建 IIS 应用程序和应用程序池。powershell脚本如下:

Param(
    [string] $branchName,
    [string] $sourceFolder
)

if (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
    [Security.Principal.WindowsBuiltInRole] "Administrator"))
{ 
    Write-Warning "You do not have Administrator rights to run this script.     `nPlease re-run this script as an Administrator."
    Exit
}

$appPool = $branchName
$site = "Default Web Site"

#Add APPPool
New-WebAppPool -Name $appPool -Force 

#Create Applications
New-WebApplication -Name $branchName -Site $site -PhysicalPath $sourceFolder -   ApplicationPool $appPool -Force    
Run Code Online (Sandbox Code Playgroud)

如果我在 PowerShell ISE 中运行脚本,它运行良好,但如果我从命令行(或使用命令行的批处理文件)运行它,我会收到错误

术语 New-WebAppPool 不被识别为 cmdlet 的名称...等。 …

iis powershell cmdlets batch-file powershell-ise

5
推荐指数
1
解决办法
5681
查看次数

强制更新nuget feed

当我们将新版本的NuGet包推送到我们的NuGet源时,该包将出现在NuGet服务器上的文件系统中.然而,NuGet feed API和visual studio中大约每小时更新一次,因此我们可能需要等待一个小时才能显示新的包.有没有办法强制更新NuGet提要以准确描述文件系统中的内容?

teamcity feed nuget

3
推荐指数
1
解决办法
1450
查看次数

在SSRS中显示空白值("")作为日期

我有DiscontinuedDate列,其中包含日期时间或空白值.我用过表达式

FormatDateTime(Fields!DiscontinuedDate.Value, DateFormat.ShortDate)
Run Code Online (Sandbox Code Playgroud)

要将日期时间显示为日期,但是当值为空时,它会显示为错误,并显示以下消息"从字符串转换""到'类型'日期'无效."

所以我一直在尝试使用如下所示的IIF表达式:

=IIF(Fields!DiscontinuedDate.Value is "", "", FormatDateTime(Fields!DiscontinuedDate.Value, DateFormat.ShortDate))
Run Code Online (Sandbox Code Playgroud)

我尝试了一些变化,但它们都带回了同样的错误.有任何想法吗?

谢谢,

亚当

null date reporting-services

2
推荐指数
1
解决办法
6806
查看次数

忽略 octopus 部署中的预发布包

在 octopus 部署中,我想在通道上创建版本规则,以确保 nuget 包上没有后缀/标签。我已经在版本控制规则的“标签”部分尝试了正则表达式,但据我所知,标签规则仅在存在标签时才有效。例如,^[^a-zA-Z0-9]+$将仅突出显示 1.0.0.0-tag 的版本号,但如果不存在标签,则不会识别 1.0.0.0。

有没有办法使用 octopus 部署中的内置版本控制仅获取没有标签的包?

nuget semantic-versioning octopus-deploy

2
推荐指数
1
解决办法
605
查看次数

RabbitMQ 稍后确认消息

为了避免队列读取器进程崩溃时的数据丢失,我们需要从 RabbitMQ 获取未确认的消息。对于每 1000 条消息,我们将消息数据提交到磁盘,然后这些消息可以标记为已确认和已消费。有没有办法让它们不被承认,然后专门针对我们刚刚得到的那些?例如,我们能否将它们添加到列表中,然后遍历该列表以查找消息?这是在 RabbitMQ .net 仅供参考。

.net indexing queue rabbitmq

1
推荐指数
1
解决办法
2910
查看次数