functionConvertTo-DataTable { <# .Synopsis Creates a DataTable from an object .Description Creates a DataTable from an object, containing all properties (except built-in properties from a database) .Example Get-ChildItem| Select Name, LastWriteTime | ConvertTo-DataTable ...
ConvertTo-Html [-InputObject <PSObject>] [[-Property] <Object[]>] [[-Body] <String[]>] [[-Head] <String[]>] [[-Title] <String>] [-As <String>] [-CssUri <Uri>] [-PostContent <String[]>] [-PreContent <String[]>] [-Meta <Hashtable>] [-Charset <String>] ...
IDictionary 至Hashtable T 到ref T 到xml scriptblock 至delegate T~1~ 到T~2~,其中 T~1~ 為整數類型,T~2~ 為列舉類型 $null T 其中T 為任何數值類型 $null 到T,其中 T 是任何參考型別 下列任何轉換: 位元組映射到 T,其中 T 是SByte UInt16 T,其中 TSByte、byte或Int16 從Int16 到T,其中...
# 监控磁盘使用情况(可用空间、已使用空间等) Get-Volume | Select-Object DriveLetter, FileSystemLabel, @{Name="UsedSpace(GB)";Expression={$_.SizeUsed/1GB}}, @{Name="FreeSpace(GB)";Expression={$_.SizeRemaining/1GB}} # 生成磁盘使用情况报告 Get-Volume | Format-Table DriveLetter, FileSystemLa...
Get-NetFirewallRule|Format-Table-Property Name, DisplayName, Enabled, Action 文件和目录管理 获取目录中所有文件的详细信息: powershellCopy Code Get-ChildItem -Path"C:\Path\To\Directory"|Select-ObjectName, Length, LastWriteTime 递归删除目录及其内容: ...
AddTableListImageAsImageWebPart$true所有页面类型表格/列表中的图像也在该表格/列表下创建为单独的图像 Web 部件。 使用-AddTableListImageAsImageWebPart参数可停止创建这些单独的图像 Web 部件。 BlogPage$false博客页面若要转换经典博客页面,请设置-BlogPage参数。 对于 Wiki、Web 部件和发布页面,此参数必须省略或设...
OrderedHashtable 备注 此cmdlet 是使用Newtonsoft Json.NET实现的。 从PowerShell 6 开始,ConvertTo-Json尝试将格式化为时间戳的字符串转换为DateTime值。 PowerShell 7.5 添加了DateKind参数,可用于控制时间戳字符串的转换方式。 该参数接受以下值: Default- 根据以下规则将时间戳转换为[datetime]实例: ...
The sorted objects are sent down the pipeline to Format-Table. The View parameter specifies the StartTime view that's defined in the PowerShell DotNetTypes.format.ps1xml file for System.Diagnostics.Process objects. The StartTime view converts each processes start time to a short date and then...
{$_.Freespace /1Gb -as [int]}} | Format-Table -AutoSize __SERVER FreeGB --- --- 08DC1 21 其中用于构造显示属性,第一个为__Server,第二个是自定义的FreeGB,用wmiobject对象的Freespace属性除以1/GB并以int类型显示 Select-Object -Property __Server,@{n='FreeGB ';e={$_.Freespace /1Gb...
There is an excellentscript on GitHubthat helps to convert a full Excel sheet toJSONformat using PowerShell. The script expects the table to be at the start of the sheet; that is, to have the first header in theA1cell. I had a little different requirement. I had to convert a specific...