小编jra*_*ara的帖子

如何在PowerShell中将数组对象转换为字符串?

如何将数组对象转换为字符串?

我试过了:

$a = "This", "Is", "a", "cat"
[system.String]::Join(" ", $a)
Run Code Online (Sandbox Code Playgroud)

没有运气.PowerShell有哪些不同的可能性?

powershell powershell-2.0

159
推荐指数
4
解决办法
43万
查看次数

SQL Server中的SYSNAME数据类型是什么?

什么是SQL Server SYSNAME数据类型?BOL说:

sysname数据类型用于存储对象名称的表列,变量和存储过程参数.

但我真的不明白.是否有可以提供的用例?

sql t-sql sql-server types

119
推荐指数
3
解决办法
12万
查看次数

SQL Server:对象名称的最大字符长度

SQL Server 2008中对象名称的最大字符长度(例如约束,列)是多少?

t-sql sql-server sql-server-2008

118
推荐指数
3
解决办法
10万
查看次数

如何从PowerShell命令行查找Windows版本?

如何找到我正在使用的Windows版本?

我正在使用PowerShell 2.0并尝试:

PS C:\> ver
The term 'ver' 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 tha
t the path is correct and try again.
At line:1 char:4
+ ver <<<< 
    + CategoryInfo          : ObjectNotFound: (ver:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
Run Code Online (Sandbox Code Playgroud)

我该怎么做呢?

windows powershell powershell-2.0

106
推荐指数
13
解决办法
33万
查看次数

PowerShell中使用的GetType,变量之间的差异

什么是变量之间的差异$a$b

$a = (Get-Date).DayOfWeek
$b = Get-Date | Select-Object DayOfWeek
Run Code Online (Sandbox Code Playgroud)

我试着检查一下

$a.GetType
$b.GetType

MemberType          : Method
OverloadDefinitions : {type GetType()}
TypeNameOfValue     : System.Management.Automation.PSMethod
Value               : type GetType()
Name                : GetType
IsInstance          : True

MemberType          : Method
OverloadDefinitions : {type GetType()}
TypeNameOfValue     : System.Management.Automation.PSMethod
Value               : type GetType()
Name                : GetType
IsInstance          : True
Run Code Online (Sandbox Code Playgroud)

但是,尽管这些变量的输出看起来不同,但似乎没有区别.

powershell powershell-2.0

71
推荐指数
3
解决办法
29万
查看次数

常用表表达式,为什么用分号?

通常在SQL ServerCommon Table Expression子句中,语句前面有分号,如下所示:

;WITH OrderedOrders AS --semicolon here
(
    SELECT SalesOrderID, OrderDate,
    ROW_NUMBER() OVER (ORDER BY OrderDate) AS 'RowNumber'
    FROM Sales.SalesOrderHeader 
) 
SELECT * 
FROM OrderedOrders 
WHERE RowNumber BETWEEN 50 AND 60
Run Code Online (Sandbox Code Playgroud)

为什么?

sql t-sql sql-server common-table-expression sql-server-2008

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

如何查找对象的属性?

如何找到$a以下属性对象?

$a = 1
$a.length
$a | Get-Member
Run Code Online (Sandbox Code Playgroud)

Get-Member似乎没有为对象生成任何属性$aproperty对象的长度是$a多少?

powershell powershell-2.0

34
推荐指数
2
解决办法
5万
查看次数

基于逻辑条件的列表中的子集元素

如何根据另一个列表中的条件(TRUE,FALSE)对列表进行子集化?请看下面的例子:

l <- list(a=c(1,2,3), b=c(4,5,6,5), c=c(3,4,5,6))
l
$a
[1] 1 2 3

$b
[1] 4 5 6 5

$c
[1] 3 4 5 6

cond <- lapply(l, function(x) length(x) > 3)
cond
$a
[1] FALSE

$b
[1] TRUE

$c
[1] TRUE

> l[cond]
Run Code Online (Sandbox Code Playgroud)

l [cond]出错:无效的下标类型'list'

conditional r list

30
推荐指数
4
解决办法
4万
查看次数

如何在加载库时禁止显示警告消息?

我正在尝试从命令行运行ar脚本,但是在加载包时会收到警告消息:

C:\Temp>Rscript myscript.r param
Warning message:
package 'RODBC' was built under R version 3.0.1
Warning message:
package 'ggplot2' was built under R version 3.0.1
Warning message:
package 'reshape2' was built under R version 3.0.1
Warning message:
package 'lubridate' was built under R version 3.0.1
Warning message:
package 'scales' was built under R version 3.0.1
Run Code Online (Sandbox Code Playgroud)

我'试着用suppressPackageStartupMessages:

suppressPackageStartupMessages(library(RODBC))
Run Code Online (Sandbox Code Playgroud)

要么 supressMessages

suppressMessages(library(RODBC))
Run Code Online (Sandbox Code Playgroud)

但这些并没有压制这些信息.如何摆脱这些警告?

r

30
推荐指数
2
解决办法
2万
查看次数

PowerShell:如何计算csv文件中的行数?

如何使用powershell计算csv文件中的行数?我试过类似的东西

Get-Content -length "C:\Directory\file.csv"
Run Code Online (Sandbox Code Playgroud)

要么

(Get-Content).length "C:\Directory\file.csv"
Run Code Online (Sandbox Code Playgroud)

但这些都会导致错误.

csv powershell command-line count powershell-1.0

20
推荐指数
3
解决办法
8万
查看次数