Skip to content

Commit 76753de

Browse files
committed
Use Import-PowerShellDataFile. Require PowerShell 5.1
1 parent ed386c6 commit 76753de

5 files changed

Lines changed: 4 additions & 19 deletions

File tree

Terminal-Icons/Private/Add-Theme.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,10 @@ function Add-Theme {
4747
if ($PSCmdlet.ShouldProcess($statusMsg, $confirmMsg, $operation) -or $Force.IsPresent) {
4848
if (-not $script:userThemeData.Themes.$Type.ContainsKey($item.BaseName) -or $Force.IsPresent) {
4949

50-
$theme = ConvertFrom-Psd1 $item.FullName
50+
$theme = Import-PowerShellDataFile $item.FullName
5151

5252
# Convert color theme into escape sequences for lookup later
5353
if ($Type -eq 'Color') {
54-
$theme = ConvertFrom-Psd1 $item.FullName
55-
5654
# Add empty color theme
5755
if (-not $script:colorSequences.ContainsKey($theme.Name)) {
5856
$script:colorSequences[$theme.Name] = New-EmptyColorTheme

Terminal-Icons/Private/ConvertFrom-Psd1.ps1

Lines changed: 0 additions & 13 deletions
This file was deleted.

Terminal-Icons/Private/Import-ColorTheme.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function Import-ColorTheme {
44

55
$hash = @{}
66
(Get-ChildItem -Path $moduleRoot/Data/colorThemes).ForEach({
7-
$colorData = ConvertFrom-Psd1 $_.FullName
7+
$colorData = Import-PowerShellDataFile $_.FullName
88
$hash[$colorData.Name] = $colorData
99
$hash[$colorData.Name].Types.Directories[''] = $colorReset
1010
$hash[$colorData.Name].Types.Files[''] = $colorReset

Terminal-Icons/Private/Import-IconTheme.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function Import-IconTheme {
44

55
$hash = @{}
66
(Get-ChildItem -Path $moduleRoot/Data/iconThemes).ForEach({
7-
$hash.Add($_.Basename, (ConvertFrom-Psd1 $_.FullName))
7+
$hash.Add($_.Basename, (Import-PowerShellDataFile $_.FullName))
88
})
99
$hash
1010
}

Terminal-Icons/Terminal-Icons.psd1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
CompanyName = 'Community'
77
Copyright = '(c) Brandon Olin. All rights reserved.'
88
Description = 'PowerShell module to add file icons to terminal based on file extension'
9-
PowerShellVersion = '4.0'
9+
PowerShellVersion = '5.1'
1010
# PowerShellHostName = ''
1111
# PowerShellHostVersion = ''
1212
RequiredModules = @()

0 commit comments

Comments
 (0)