Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replacing ConvertTo-Expression with content from iRon7's repo #57

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .build/InjectScriptCode.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
task InjectScriptCode {

$uri = 'https://raw.githubusercontent.com/iRon7/ConvertTo-Expression/master/ConvertTo-Expression.ps1'
$moduleFilePath = Join-Path -Path $SourcePath -ChildPath 'Modules\ConvertToExpression\ConvertToExpression.psm1'

$functionContent = Invoke-WebRequest -Uri $uri -UseBasicParsing | Select-Object -ExpandProperty Content
$functionContent = $functionContent.Replace('using namespace System.Management.Automation', '')
$functionContent = $functionContent.Replace('PSMethod', 'System.Management.Automation.PSMethod')

$moduleFileContent = Get-Content -Path $moduleFilePath -Raw
$moduleFileContent = $moduleFileContent.Replace("'TOBEREPACED'", $functionContent)

$moduleFileContent | Set-Content -Path $moduleFilePath -Encoding UTF8

}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Based on [style guidelines](https://dsccommunity.org/styleguidelines/localizatio
- Updated the README.md with new section and updated the links.
- Renamed class files adding a prefix on each file so the task `Generate_Wiki_Content`
works (reported issue https://github.com/dsccommunity/DscResource.DocGenerator/issues/132).
- Removed code of `ConvertTo-Expression` and injecting it from https://github.com/iRon7/ConvertTo-Expression.

### Removed

Expand Down
5 changes: 4 additions & 1 deletion build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ BuildWorkflow:

build:
- Clean
- InjectScriptCode
- Build_Module_ModuleBuilder
- Build_NestedModules_ModuleBuilder
- Create_changelog_release_output
Expand Down Expand Up @@ -67,7 +68,7 @@ Pester:
- tests/Unit
ExcludeTag:
Tag:
CodeCoverageThreshold: 25
CodeCoverageThreshold: 6
CodeCoverageOutputFile: JaCoCo_coverage.xml
CodeCoverageOutputFileEncoding: ascii

Expand All @@ -79,8 +80,10 @@ DscTest:
Tag:
ExcludeSourceFile:
- output
- Modules/ConvertToExpression
ExcludeModuleFile:
- Modules/DscResource.Common
- Modules/ConvertToExpression

ModuleBuildTasks:
Sampler:
Expand Down
3 changes: 3 additions & 0 deletions source/Classes/005.RoleCapabilitiesUtility.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ $modulePath = Join-Path -Path $PSScriptRoot -ChildPath Modules
Import-Module -Name (Join-Path -Path $modulePath -ChildPath DscResource.Common)
Import-Module -Name (Join-Path -Path $modulePath -ChildPath (Join-Path -Path JeaDsc.Common -ChildPath JeaDsc.Common.psm1))

Import-Module -Name (Join-Path -Path $modulePath -ChildPath ConvertToExpression)
Import-Module -Name (Join-Path -Path $modulePath -ChildPath (Join-Path -Path ConvertToExpression -ChildPath ConvertToExpression.psm1))

$script:localizedDataRole = Get-LocalizedData -DefaultUICulture en-US -FileName 'JeaRoleCapabilities.strings.psd1'

class RoleCapabilitiesUtility
Expand Down
4 changes: 1 addition & 3 deletions source/JeaDsc.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@

NestedModules = @()

FunctionsToExport = @(
'ConvertTo-Expression'
)
FunctionsToExport = @()

CmdletsToExport = @()

Expand Down
4 changes: 4 additions & 0 deletions source/Modules/ConvertToExpression/ConvertToExpression.psm1
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
function ConvertTo-Expression
{
'TOBEREPACED'
}
Loading