Skip to content

Commit

Permalink
Merge pull request #41 from lipkau/fix/compatibilityPSv2
Browse files Browse the repository at this point in the history
Fixed parameter property declaration
  • Loading branch information
lipkau authored Sep 17, 2018
2 parents 2ce2571 + 639aee4 commit 2b8dc75
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 26 deletions.
8 changes: 4 additions & 4 deletions PSIni/Functions/Add-IniComment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,19 @@ Function Add-IniComment {
Param
(
# Specifies the path to the input file.
[Parameter( Position = 0, Mandatory, ParameterSetName = "File" )]
[Parameter( Position = 0, Mandatory = $true, ParameterSetName = "File" )]
[ValidateNotNullOrEmpty()]
[String]
$FilePath,

# Specifies the Hashtable to be modified. Enter a variable that contains the objects or type a command or expression that gets the objects.
[Parameter( Mandatory, ValueFromPipeline, ParameterSetName = "Object" )]
[Parameter( Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = "Object" )]
[ValidateNotNullOrEmpty()]
[System.Collections.IDictionary]
$InputObject,

# String array of one or more keys to limit the changes to, separated by a comma. Optional.
[Parameter( Mandatory )]
[Parameter( Mandatory = $true )]
[ValidateNotNullOrEmpty()]
[String[]]
$Keys,
Expand All @@ -85,7 +85,7 @@ Function Add-IniComment {
# Note: This parameter is a char array to maintain compatibility with the other functions.
# However, only the first character is used to comment out entries.
# Default: ";"
[char[]]
[Char[]]
$CommentChar = @(";"),

# String array of one or more sections to limit the changes to, separated by a comma.
Expand Down
8 changes: 4 additions & 4 deletions PSIni/Functions/Get-IniContent.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@ Function Get-IniContent {
Param(
# Specifies the path to the input file.
[ValidateNotNullOrEmpty()]
[Parameter( Mandatory, ValueFromPipeline )]
[string]
[Parameter( Mandatory = $true, ValueFromPipeline = $true )]
[String]
$FilePath,

# Specify what characters should be describe a comment.
# Lines starting with the characters provided will be rendered as comments.
# Default: ";"
[char[]]
[Char[]]
$CommentChar = @(";"),

# Remove lines determined to be comments from the resulting dictionary.
[switch]
[Switch]
$IgnoreComments
)

Expand Down
16 changes: 8 additions & 8 deletions PSIni/Functions/Out-IniFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -73,37 +73,37 @@ Function Out-IniFile {
# -- UTF8: Encodes in UTF-8 format.
[ValidateSet("Unicode", "UTF7", "UTF8", "ASCII", "BigEndianUnicode", "Byte", "String")]
[Parameter()]
[string]
[String]
$Encoding = "UTF8",

# Specifies the path to the output file.
[ValidateNotNullOrEmpty()]
[ValidateScript( {Test-Path $_ -IsValid} )]
[Parameter( Position = 0, Mandatory )]
[string]
[Parameter( Position = 0, Mandatory = $true )]
[String]
$FilePath,

# Allows the cmdlet to overwrite an existing read-only file. Even using the Force parameter, the cmdlet cannot override security restrictions.
[switch]
[Switch]
$Force,

# Specifies the Hashtable to be written to the file. Enter a variable that contains the objects or type a command or expression that gets the objects.
[Parameter( Mandatory, ValueFromPipeline )]
[Parameter( Mandatory = $true, ValueFromPipeline = $true )]
[System.Collections.IDictionary]
$InputObject,

# Passes an object representing the location to the pipeline. By default, this cmdlet does not generate any output.
[switch]
[Switch]
$Passthru,

# Adds spaces around the equal sign when writing the key = value
[switch]
[Switch]
$Loose,

# Writes the file as "pretty" as possible
#
# Adds an extra linebreak between Sections
[switch]
[Switch]
$Pretty
)

Expand Down
8 changes: 4 additions & 4 deletions PSIni/Functions/Remove-IniComment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,27 @@ Function Remove-IniComment {
Param
(
# Specifies the path to the input file.
[Parameter( Position = 0, Mandatory, ParameterSetName = "File" )]
[Parameter( Position = 0, Mandatory = $true, ParameterSetName = "File" )]
[ValidateNotNullOrEmpty()]
[String]
$FilePath,

# Specifies the Hashtable to be modified. Enter a variable that contains the objects or type a command or expression that gets the objects.
[Parameter( Mandatory, ValueFromPipeline, ParameterSetName = "Object" )]
[Parameter( Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = "Object" )]
[ValidateNotNullOrEmpty()]
[System.Collections.IDictionary]
$InputObject,

# String array of one or more keys to limit the changes to, separated by a comma. Optional.
[Parameter(Mandatory)]
[Parameter( Mandatory = $true )]
[ValidateNotNullOrEmpty()]
[String[]]
$Keys,

# Specify what characters should be describe a comment.
# Lines starting with the characters provided will be rendered as comments.
# Default: ";"
[char[]]
[Char[]]
$CommentChar = @(";"),

# String array of one or more sections to limit the changes to, separated by a comma.
Expand Down
4 changes: 2 additions & 2 deletions PSIni/Functions/Remove-IniEntry.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ Function Remove-IniEntry {
Param
(
# Specifies the path to the input file.
[Parameter( Position = 0, Mandatory, ParameterSetName = "File")]
[Parameter( Position = 0, Mandatory = $true, ParameterSetName = "File")]
[ValidateNotNullOrEmpty()]
[String]
$FilePath,

# Specifies the Hashtable to be modified.
# Enter a variable that contains the objects or type a command or expression that gets the objects.
[Parameter( Mandatory, ValueFromPipeline, ParameterSetName = "Object" )]
[Parameter( Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = "Object" )]
[System.Collections.IDictionary]
$InputObject,

Expand Down
8 changes: 4 additions & 4 deletions PSIni/Functions/Set-IniContent.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,21 @@ Function Set-IniContent {
Param
(
# Specifies the path to the input file.
[Parameter( Position = 0, Mandatory, ParameterSetName = "File" )]
[Parameter( Position = 0, Mandatory = $true, ParameterSetName = "File" )]
[ValidateNotNullOrEmpty()]
[String]
$FilePath,

# Specifies the Hashtable to be modified.
# Enter a variable that contains the objects or type a command or expression that gets the objects.
[Parameter( Mandatory, ValueFromPipeline, ParameterSetName = "Object")]
[Parameter( Mandatory = $true, ValueFromPipeline = $true, ParameterSetName = "Object")]
[ValidateNotNullOrEmpty()]
[System.Collections.IDictionary]
$InputObject,

# Hashtable of one or more key names and values to modify. Required.
[Parameter( Mandatory, ParameterSetName = "File")]
[Parameter( Mandatory, ParameterSetName = "Object")]
[Parameter( Mandatory = $true, ParameterSetName = "File")]
[Parameter( Mandatory = $true, ParameterSetName = "Object")]
[ValidateNotNullOrEmpty()]
[HashTable]
$NameValuePairs,
Expand Down

0 comments on commit 2b8dc75

Please sign in to comment.