如何将数组对象转换为字符串?
我试过了:
$a = "This", "Is", "a", "cat"
[system.String]::Join(" ", $a)
Run Code Online (Sandbox Code Playgroud)
没有运气.PowerShell有哪些不同的可能性?
SQL Server 2008中对象名称的最大字符长度(例如约束,列)是多少?
如何找到我正在使用的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)
我该怎么做呢?
什么是变量之间的差异$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)
但是,尽管这些变量的输出看起来不同,但似乎没有区别.
通常在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
如何找到$a以下属性对象?
$a = 1
$a.length
$a | Get-Member
Run Code Online (Sandbox Code Playgroud)
Get-Member似乎没有为对象生成任何属性$a?property对象的长度是$a多少?
如何根据另一个列表中的条件(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'
我正在尝试从命令行运行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)
但这些并没有压制这些信息.如何摆脱这些警告?
如何使用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)
但这些都会导致错误.
powershell ×5
sql-server ×3
t-sql ×3
r ×2
sql ×2
command-line ×1
conditional ×1
count ×1
csv ×1
list ×1
types ×1
windows ×1