]> git.ardis.lu - ArdisUtilities/commitdiff
Rename to Get-ExtendedFileProperty
authorArdis Lu <ardisglu@gmail.com>
Mon, 4 Jul 2022 07:09:28 +0000 (00:09 -0700)
committerArdis Lu <ardisglu@gmail.com>
Mon, 4 Jul 2022 07:09:28 +0000 (00:09 -0700)
Microsoft guidelines recommend using singular nouns in cmdlets

ArdisUtilities/ArdisUtilities.psd1
ArdisUtilities/ArdisUtilities.psm1

index 37a1b70f78262edd9fdd23f69ae41b762cce48c7..97e6b6fdb5857d63caa16271f7bfb4c659f6aed6 100644 (file)
@@ -4,7 +4,7 @@
   GUID              = '57a6bea3-0ea5-44b3-95d2-71d122772f1c'
   Author            = 'Ardis Lu'
   Description       = 'My personal utility functions.'
-  FunctionsToExport = @('Invoke-RandomFile', 'ConvertTo-Base64String', 'Get-StringHash', 'Get-SizeDurationRatio', 'Get-ExtendedFileProperties')
+  FunctionsToExport = @('Invoke-RandomFile', 'ConvertTo-Base64String', 'Get-StringHash', 'Get-SizeDurationRatio', 'Get-ExtendedFileProperty')
   CmdletsToExport   = @()
   VariablesToExport = @()
   AliasesToExport   = @()
index 5fbf9787e608a5f3eeec0fbcbd03892517a43ed9..3e0ec27d6eccc957fb336dca9c0f4e6867e10e5b 100644 (file)
@@ -305,7 +305,7 @@ function Get-SizeDurationRatio {
   }
 }
 
-class ExtendedFileProperties {
+class ExtendedFileProperty {
   [String]$Path
   [String]$FileName
   [Int]$PropertyIndex
@@ -313,13 +313,13 @@ class ExtendedFileProperties {
   [String]$PropertyValue
 }
 
-$ExtendedFilePropertiesDisplay = @{
-  TypeName                  = 'ExtendedFileProperties'
+$ExtendedFilePropertyDisplay = @{
+  TypeName                  = 'ExtendedFileProperty'
   DefaultDisplayPropertySet = 'FileName', 'PropertyName', 'PropertyValue'
 }
-Update-TypeData @ExtendedFilePropertiesDisplay -Force
+Update-TypeData @ExtendedFilePropertyDisplay -Force
 
-function Get-ExtendedFileProperties {
+function Get-ExtendedFileProperty {
   <#
   .SYNOPSIS
     Gets a file's extended file properties.
@@ -333,7 +333,7 @@ function Get-ExtendedFileProperties {
     The path to the file to get extended file properties for.
 
   .EXAMPLE
-    PS> Get-ExtendedFileProperties example.mp4 
+    PS> Get-ExtendedFileProperty example.mp4 
 
     FileName    PropertyName      PropertyValue
     --------    ------------      -------------
@@ -349,7 +349,7 @@ function Get-ExtendedFileProperties {
     (...)
 
   .EXAMPLE
-    PS> Get-ExtendedFileProperties example.mp4 | where PropertyName -like 'Date*'
+    PS> Get-ExtendedFileProperty example.mp4 | where PropertyName -like 'Date*'
 
 
     FileName    PropertyName  PropertyValue
@@ -359,7 +359,7 @@ function Get-ExtendedFileProperties {
     example.mp4 Date accessed 12/26/2021 12:37 AM
 
   .EXAMPLE
-    PS> @('example.mp4', 'example2.mp4') | Get-ExtendedFileProperties | where PropertyName -in 'Size', 'Length', 'Frame width', 'Frame height', 'Total bitrate'
+    PS> @('example.mp4', 'example2.mp4') | Get-ExtendedFileProperty | where PropertyName -in 'Size', 'Length', 'Frame width', 'Frame height', 'Total bitrate'
 
 
     FileName     PropertyName  PropertyValue
@@ -376,7 +376,7 @@ function Get-ExtendedFileProperties {
     example2.mp4 Total bitrate 952kbps
   #>
 
-  [OutputType([ExtendedFileProperties])]
+  [OutputType([ExtendedFileProperty])]
   [CmdletBinding()]
   param(
     [Parameter(Mandatory, ValueFromPipeline)]
@@ -399,7 +399,7 @@ function Get-ExtendedFileProperties {
     foreach ($i in 0..512) {
       $property = $folderObject.GetDetailsOf($fileObject, $i)
       if ($property) {
-        [ExtendedFileProperties] @{
+        [ExtendedFileProperty] @{
           Path          = $resolvedPath
           FileName      = $fileName
           PropertyIndex = $i
This page took 0.04394 seconds and 4 git commands to generate.