diff --git a/.gitmodules b/.gitmodules index c991d073e..17765f683 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,5 +1,5 @@ [submodule "src/Modules/Pester"] - path = src/Modules/Pester + path = src/Modules/Shared/Pester url = https://github.com/PowerShell/psl-pester.git branch = develop ignore = dirty diff --git a/.travis.yml b/.travis.yml index 0c65a78a8..e0709ce23 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ git: submodules: false before_install: - git config --global url.git@github.com:.insteadOf https://github.com/ - - git submodule update --init -- src/Modules/Pester src/libpsl-native/test/googletest + - git submodule update --init - ./tools/download.sh script: - ulimit -n 4096; powershell -c "Import-Module ./build.psm1; Start-PSBootstrap; Start-PSBuild -Publish; Start-PSPester; Start-PSxUnit" diff --git a/appveyor.yml b/appveyor.yml index 5f469df7d..f743073eb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -18,7 +18,7 @@ install: - ps: $fileContent += "`n-----END RSA PRIVATE KEY-----`n" - ps: Set-Content c:\users\appveyor\.ssh\id_rsa $fileContent - git config --global url.git@github.com:.insteadOf https://github.com/ - - git submodule update --init -- src/Modules/Pester + - git submodule update --init - ps: Import-Module .\build.psm1; Start-PSBootstrap build_script: @@ -43,7 +43,7 @@ test_script: $env:FullOutput = Split-Path -Parent (Get-PSOutput -Options (New-PSOptions -FullCLR)) Write-Host -Foreground Green 'Run FullCLR tests' $testResultsFileFullCLR = "$pwd\TestsResults.FullCLR.xml" - Start-DevPSGitHub -binDir $env:FullOutput -NoNewWindow -ArgumentList '-noprofile', '-noninteractive', '-command', "Import-Module .\src\Modules\Pester; Invoke-Pester test/fullCLR -OutputFormat NUnitXml -OutputFile $testResultsFileFullCLR" + Start-DevPowerShell -NoNewWindow -ArgumentList '-noprofile', '-noninteractive' -Command "Invoke-Pester test/fullCLR -OutputFormat NUnitXml -OutputFile $testResultsFileFullCLR" (New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFileFullCLR)) # # Fail the build, if tests failed diff --git a/build.psm1 b/build.psm1 index 3207df83a..0a6015f5b 100644 --- a/build.psm1 +++ b/build.psm1 @@ -59,12 +59,11 @@ function Start-PSBuild { [switch]$XamlGen, [Parameter(ParameterSetName='FullCLR')] - [string]$cmakeGenerator = "Visual Studio 14 2015 Win64", + [ValidateSet('x86', 'x64')] + [string]$NativeHostArch = "x64", - [Parameter(ParameterSetName='FullCLR')] - [ValidateSet("Debug", - "Release")] - [string]$msbuildConfiguration = "Release" + [ValidateSet('Linux', 'Debug', 'Release', '')] + [string]$Configuration ) if ($Clean) @@ -104,6 +103,26 @@ function Start-PSBuild { throw 'mc.exe not found. Install Microsoft Windows SDK.' } + # setup msbuild configuration + if ($Configuration -eq 'Debug' -or $Configuration -eq 'Release') + { + $msbuildConfiguration = $Configuration + } + else + { + $msbuildConfiguration = 'Release' + } + + # setup cmakeGenerator + if ($NativeHostArch -eq 'x86') + { + $cmakeGenerator = 'Visual Studio 14 2015' + } + else + { + $cmakeGenerator = 'Visual Studio 14 2015 Win64' + } + } elseif ($IsLinux -or $IsOSX) { foreach ($Dependency in 'cmake', 'make', 'g++') { $precheck = $precheck -and (precheck $Dependency "Build dependency '$Dependency' not found. Run Start-PSBootstrap.") @@ -116,7 +135,7 @@ function Start-PSBuild { } # set output options - $OptionsArguments = @{Publish=$Publish; Output=$Output; FullCLR=$FullCLR; Runtime=$Runtime} + $OptionsArguments = @{Publish=$Publish; Output=$Output; FullCLR=$FullCLR; Runtime=$Runtime; Configuration=$Configuration; Verbose=$true} $script:Options = New-PSOptions @OptionsArguments # setup arguments @@ -239,7 +258,7 @@ function Start-PSBuild { function New-PSOptions { [CmdletBinding()] param( - [ValidateSet("Linux", "Debug", "Release")] + [ValidateSet("Linux", "Debug", "Release", "")] [string]$Configuration, [ValidateSet("netcoreapp1.0", "net451")] @@ -279,7 +298,7 @@ function New-PSOptions { } elseif ($IsWindows) { "Debug" } - log "Using configuration '$Configuration'" + Write-Verbose "Using configuration '$Configuration'" } if (-not $Framework) { @@ -288,7 +307,7 @@ function New-PSOptions { } else { "netcoreapp1.0" } - log "Using framework '$Framework'" + Write-Verbose "Using framework '$Framework'" } if (-not $Runtime) { @@ -301,7 +320,7 @@ function New-PSOptions { if (-not $Runtime) { Throw "Could not determine Runtime Identifier, please update dotnet" } else { - log "Using runtime '$Runtime'" + Write-Verbose "Using runtime '$Runtime'" } } @@ -649,20 +668,37 @@ function Publish-NuGetFeed } -function Start-DevPSGitHub { +function Start-DevPowerShell { param( [switch]$ZapDisable, [string[]]$ArgumentList = '', [switch]$LoadProfile, - [string]$binDir = "$PSScriptRoot\src\Microsoft.PowerShell.ConsoleHost\bin\Debug\net451", - [switch]$NoNewWindow + [string]$binDir = (Split-Path (New-PSOptions -FullCLR).Output), + [switch]$NoNewWindow, + [string]$Command, + [switch]$KeepPSModulePath ) try { - if ($LoadProfile -eq $false) { + if (-not $LoadProfile) { $ArgumentList = @('-noprofile') + $ArgumentList } + if (-not $KeepPSModulePath) + { + if (-not $Command) + { + $ArgumentList = @('-NoExit') + $ArgumentList + } + + $Command = '$env:PSModulePath = Join-Path $env:DEVPATH Modules; ' + $Command + } + + if ($Command) + { + $ArgumentList = $ArgumentList + @("-command $Command") + } + $env:DEVPATH = $binDir if ($ZapDisable) { $env:COMPLUS_ZapDisable = 1 @@ -841,7 +877,16 @@ function Get-Mappings { $map = @{} $mapFiles | % { - $rawHashtable = $_ | Get-Content -Raw | ConvertFrom-Json | Convert-PSObjectToHashtable + $file = $_ + try + { + $rawHashtable = $_ | Get-Content -Raw | ConvertFrom-Json | Convert-PSObjectToHashtable + } + catch + { + Write-Error "Exception, when processing $($file.FullName): $_" + } + $mapRoot = Split-Path $_.FullName if ($KeepRelativePaths) { @@ -986,6 +1031,37 @@ function Find-Dotnet() { } } +<# + This is one-time conversion. We use it for to turn GetEventResources.txt into GetEventResources.resx + + .EXAMPLE Convert-TxtResourceToXml -Path Microsoft.PowerShell.Commands.Diagnostics\resources +#> +function Convert-TxtResourceToXml +{ + param( + [string[]]$Path + ) + + process + { + $Path | % { + Get-ChildItem $_ -Filter "*.txt" | % { + $txtFile = $_.FullName + $resxFile = Join-Path (Split-Path $txtFile) "$($_.BaseName).resx" + $resourceHashtable = ConvertFrom-StringData (Get-Content -Raw $txtFile) + $resxContent = $resourceHashtable.GetEnumerator() | % { +@' + + {1} + +'@ -f $_.Key, $_.Value + } | Out-String + Set-Content -Path $resxFile -Value ($script:RESX_TEMPLATE -f $resxContent) + } + } + } +} + function Start-XamlGen { [CmdletBinding()] @@ -1557,3 +1633,128 @@ function New-AppxPackage return $appxPackagePath } + + +$script:RESX_TEMPLATE = @' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + +{0} + +'@ \ No newline at end of file diff --git a/docs/building/internals.md b/docs/building/internals.md index ca22828a8..f9bc60729 100644 --- a/docs/building/internals.md +++ b/docs/building/internals.md @@ -32,14 +32,3 @@ it should be listed as a dependency for FullCLR $Top folder (src\Microsoft.Power * If assembly is part of CoreCLR build, it should be listed as a dependency for CoreCLR $Top folder (src\powershell) - - -Modules ----------- - -There are 3 modules directories with the same purpose: they have **content** files (i.e. `*.psm1`, `*.psd1`) -which would be binplaced by `dotnet` - -- `src\Modules` shared between all flavours -- `src\Microsoft.PowerShell.ConsoleHost\Modules` FullCLR (Windows) -- `src\powershell\Modules` CoreCLR (all platforms) diff --git a/docs/building/windows-full.md b/docs/building/windows-full.md index 8e51cde4c..5ec0910fe 100644 --- a/docs/building/windows-full.md +++ b/docs/building/windows-full.md @@ -51,7 +51,7 @@ module. Because the `ConsoleHost` project (*not* the `Host` project) is a library and not an application (in the sense that .NET CLI does not emit a native executable using .NET Core's `corehost`), it targets the -framework `netstandard1.5`, *not* `netcoreapp1.0`, and the build +framework `netstandard1.6`, *not* `netcoreapp1.0`, and the build output will *not* have a runtime identifier in the path. Thus the output location of `powershell.exe` will be @@ -69,34 +69,24 @@ Assembly Cache (GAC), not your output directory. and run side-by-side. ```powershell -Start-DevPSGithub +Start-DevPowerShell ``` This command has a reasonable default to run `powershell.exe` from the build output folder. If you are building an unusual configuration (i.e. not `Debug`), you can explicitly specify path to the bin directory ```powershell -Start-DevPSGithub -binDir .\src\Microsoft.PowerShell.ConsoleHost\bin\Debug\net451 +Start-DevPowerShell -binDir .\src\Microsoft.PowerShell.ConsoleHost\bin\Debug\net451 ``` Or more programmatically: ```powershell -Start-DevPSGithub -binDir (Split-Path -Parent (Get-PSOutput)) +Start-DevPowerShell -binDir (Split-Path -Parent (Get-PSOutput)) ``` -The default for `powershell.exe` that **we build** is x86. See -[issue #683][]. - -There is a separate execution policy registry key for x86, and it's -likely that you didn't ~~bypass~~ enable it. From **powershell.exe -(x86)** run: - -``` -Set-ExecutionPolicy Bypass -``` - -[issue #683]: https://github.com/PowerShell/PowerShell/issues/683 +The default for produced `powershell.exe` is x64. +You can contorl it with `Start-PSBuild -FullCLR -NativeHostArch x86` Build manually ============== @@ -104,7 +94,7 @@ Build manually The build logic is relatively simple and contains the following steps: - building managed DLLs: `dotnet publish --runtime net451` -- generating Visual Studio project: `cmake -G "$cmakeGenerator"` +- generating Visual Studio project: `cmake` - building `powershell.exe` from generated solution: `msbuild powershell.sln` diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/CommonUtils.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/CommonUtils.cs index cd2050f3d..e51685365 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/CommonUtils.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/CommonUtils.cs @@ -3,19 +3,14 @@ using System.Collections; using System.Diagnostics; using System.Runtime.InteropServices; using System.Text; - +using System.Resources; +using System.Reflection; namespace Microsoft.PowerShell.Commands.Diagnostics.Common { - internal class CommonUtilities + internal static class CommonUtilities { - // - // No-op private ctor to prevent the default ctor from getting generated. - // This class is intended to only have static members. - // - private CommonUtilities() { } - // // StringArrayToString helper converts a string array into a comma-separated string. // Note this has only limited use, individual strings cannot have commas. @@ -117,6 +112,12 @@ namespace Microsoft.PowerShell.Commands.Diagnostics.Common return formatError; } + public static ResourceManager GetResourceManager() + { + // this naming pattern is dictated by the dotnet cli + return new ResourceManager("Microsoft.PowerShell.Commands.Diagnostics.resources.GetEventResources", typeof(CommonUtilities).GetTypeInfo().Assembly); + } + } } diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSample.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSample.cs index 29bdd7845..a7cdd86d1 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSample.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/CounterSample.cs @@ -145,7 +145,7 @@ namespace Microsoft.PowerShell.Commands.GetCounter { internal PerformanceCounterSampleSet() { - _resourceMgr = new ResourceManager("GetEventResources", Assembly.GetExecutingAssembly()); + _resourceMgr = Microsoft.PowerShell.Commands.Diagnostics.Common.CommonUtilities.GetResourceManager(); } internal PerformanceCounterSampleSet (DateTime timeStamp, diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/ExportCounterCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/ExportCounterCommand.cs index 9104fc838..49246e66f 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/ExportCounterCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/ExportCounterCommand.cs @@ -152,7 +152,7 @@ namespace Microsoft.PowerShell.Commands protected override void BeginProcessing() { - _resourceMgr = new ResourceManager("GetEventResources", Assembly.GetExecutingAssembly()); + _resourceMgr = Microsoft.PowerShell.Commands.Diagnostics.Common.CommonUtilities.GetResourceManager(); // // Determine the OS version: this cmdlet requires Windows 7 diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs index b0eac6410..815f10705 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/GetCounterCommand.cs @@ -203,7 +203,7 @@ namespace Microsoft.PowerShell.Commands // protected override void BeginProcessing() { - _resourceMgr = new ResourceManager("GetEventResources", Assembly.GetExecutingAssembly()); + _resourceMgr = Microsoft.PowerShell.Commands.Diagnostics.Common.CommonUtilities.GetResourceManager(); _pdhHelper = new PdhHelper(System.Environment.OSVersion.Version.Major < 6); uint res = _pdhHelper.ConnectToDataSource(); diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs index 019c0b014..f8dfa499a 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/GetEventCommand.cs @@ -396,7 +396,7 @@ namespace Microsoft.PowerShell.Commands // protected override void BeginProcessing() { - _resourceMgr = new ResourceManager("GetEventResources", typeof(GetWinEventCommand).GetTypeInfo().Assembly); + _resourceMgr = Microsoft.PowerShell.Commands.Diagnostics.Common.CommonUtilities.GetResourceManager(); } diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/ImportCounterCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/ImportCounterCommand.cs index a54c5e7b5..ffa460119 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/ImportCounterCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/ImportCounterCommand.cs @@ -189,7 +189,7 @@ namespace Microsoft.PowerShell.Commands // protected override void BeginProcessing() { - _resourceMgr = new ResourceManager("GetEventResources", Assembly.GetExecutingAssembly()); + _resourceMgr = Microsoft.PowerShell.Commands.Diagnostics.Common.CommonUtilities.GetResourceManager(); _pdhHelper = new PdhHelper(System.Environment.OSVersion.Version.Major < 6); } diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs b/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs index 7c4326540..0f80fa729 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/NewWinEventCommand.cs @@ -13,7 +13,7 @@ using System.Diagnostics.CodeAnalysis; using System.Collections.Generic; using System.Xml; using System.IO; - + namespace Microsoft.PowerShell.Commands { /// @@ -28,7 +28,7 @@ namespace Microsoft.PowerShell.Commands private const string TemplateTag = "template"; private const string DataTag = "data"; - private ResourceManager _resourceMgr = new ResourceManager("GetEventResources", typeof(NewWinEventCommand).GetTypeInfo().Assembly); + private ResourceManager _resourceMgr = Microsoft.PowerShell.Commands.Diagnostics.Common.CommonUtilities.GetResourceManager(); /// diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/project.json b/src/Microsoft.PowerShell.Commands.Diagnostics/project.json index 9796030c2..231795604 100644 --- a/src/Microsoft.PowerShell.Commands.Diagnostics/project.json +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/project.json @@ -29,8 +29,7 @@ "ExportCounterCommand.cs", "GetCounterCommand.cs", "ImportCounterCommand.cs", - "CounterFileInfo.cs", - "CommonUtils.cs" + "CounterFileInfo.cs" ] } } diff --git a/src/Microsoft.PowerShell.Commands.Diagnostics/resources/GetEventResources.resx b/src/Microsoft.PowerShell.Commands.Diagnostics/resources/GetEventResources.resx new file mode 100644 index 000000000..350312484 --- /dev/null +++ b/src/Microsoft.PowerShell.Commands.Diagnostics/resources/GetEventResources.resx @@ -0,0 +1,289 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The {0} file does not have the expected file name extension. Specify only .blg, .csv, or .tsv files when you use the Path parameter. + + + Internal performance counter API call failed. Error: {0:x8}. + + + You must specify at least one Log, Provider or Path key-value pair. + + + There is not an event provider on the {0} computer that matches "{1}". + + + A null value was encountered in the {0} hash table key. Null values are not permitted. + + + Constructed structured query: +{0}. + + + The {0} provider writes events to the {1} log. + + + The value of the StartTime parameter must be less than the value of the EndTime parameter. + + + There is not an event log on the {0} computer that matches "{1}". + + + Microsoft + + + The Circular parameter will be ignored unless the MaxSize parameter is also specified. + + + Unable to open the {0} file for writing. + + + Invalid value '{0}' specified for keyword. + + + The {0} performance counter cannot be exported to the {1} file because it was not part of the first sample set. + + + No events were found that match the specified selection criteria. + + + The default values for this command failed. Error: {0:x8}. + + + You cannot import different types of performance log files in the same command. Specify only one type of file in the Path parameter. + + + The {0} path does not appear to be a valid log file path. Specify a valid file system path. + + + A valid Event Id must be specified. + + + Could not retrieve information about the {0} provider. Error: {1}. + + + The {0} event log can be read only in the forward chronological order because it is an analytical or a debug log. To see events from the {0} event log, use the Oldest parameter in the command. + + + The following export destination path is ambiguous: {0}. + + + The {0} performance counter path is not valid. + + + The data in one of the performance counter samples is not valid. View the Status property for each PerformanceCounterSample object to make sure it contains valid data. + + + Provided payload does not match with the template that was defined for event id {0}. +The defined template is following: +{1} + + + Cannot find any performance counter sets on the {0} computer that match the following: {1}. + + + No valid counter paths were found in the files. + + + Unable to create the {0} file. Verify that the path is valid. + + + Could not find any performance counter sets on the {0} computer: error {1:x8}. Verify that the {0} computer exists, that it is discoverable, and that you have sufficient privileges to view performance counter data on that computer. + + + Event cannot be written because there are no events defined with id {0} for the provider {1}. Please correct the event id and try again. + + + The {0} Context key-value is not a valid SID or NT account name. + + + Event cannot be written because the specified version {0} for event {1} is not defined for the provider {2}. Please correct the version and try again. + + + The {0} format type is not a valid format for a counter file. Possible values for the Format parameter are .blg, .csv, or .tsv. + + + You cannot import more than 32 .blg counter log files in each command. + + + The specified providers do not write events to the {0} log. This log will be ignored. + + + The following value is not in a valid security identifier (SID) format: {0}. Enter a valid SID, such as S-1-5-32-544. + + + No provider found with name {0}. + + + Cannot retrieve information about the {0} performance counter set because access was denied. + + + Event cannot be written because multiple events with id {0} have beend defined for provider {1}. Please provide a version for the event and try again. + + + The {0} event log file can be read only in the forward chronological order because it is an .etl or an .evt file. To see events from the {0} event log, use the Oldest parameter in the command. + + + Provider name must be specified. + + + The {0} file does not appear to be a valid log file. Specify only .evtx, .etl, or .evt files as values of the Path parameter. + + + The {0} performance counter path is either not valid or it is not present in the following files: {1}. + + + Timestamp + + + The following value is not in a valid DateTime format: {0}. + + + Could not retrieve information about the {0} log. Error: {1}. + + + Cannot retrieve event message text. + + + The {0} file already exists. To overwrite this file, use the Force parameter in the Export-Counter command. + + + The Continuous parameter and the MaxSamples parameter cannot be used in the same command. + + + This cmdlet can be run only on Microsoft Windows 7 and above. + + + This Windows PowerShell snap-in contains Windows Eventing and Performance Counter cmdlets. + + + Cannot find any performance counter sets in the {0} files that match the following: {1}. + + + The specified providers do not write events to any of the specified logs. + + + Cooked Values + + + You cannot import more than one comma-separated (.csv) or tab-separated (.tsv) performance counter file in each command. + + + diff --git a/src/Microsoft.PowerShell.ConsoleHost/Modules/map.json b/src/Microsoft.PowerShell.ConsoleHost/Modules/map.json deleted file mode 100644 index d060b10a2..000000000 --- a/src/Microsoft.PowerShell.ConsoleHost/Modules/map.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "monad/miscfiles/modules/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1": "Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1", - "monad/miscfiles/modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1": "Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1", - "monad/src/ScheduledJob/PSScheduledJob.Format.ps1xml": "PSScheduledJob/PSScheduledJob.Format.ps1xml", - "monad/src/ScheduledJob/PSScheduledJob.psd1": "PSScheduledJob/PSScheduledJob.psd1", - "monad/src/ScheduledJob/PSScheduledJob.types.ps1xml": "PSScheduledJob/PSScheduledJob.types.ps1xml", - "monad/src/m3p/product/PSWorkflow.psd1" : "PSWorkflow/PSWorkflow.psd1", - "monad/src/m3p/product/PSWorkflow.psm1" : "PSWorkflow/PSWorkflow.psm1", - "monad/src/m3p/product/PSWorkflow.types.ps1xml" : "PSWorkflow/PSWorkflow.types.ps1xml", - "monad/src/m3p/product/PSWorkflowUtility.psd1" : "PSWorkflowUtility/PSWorkflowUtility.psd1", - "monad/src/m3p/product/PSWorkflowUtility.psm1" : "PSWorkflowUtility/PSWorkflowUtility.psm1" -} diff --git a/src/Microsoft.PowerShell.ConsoleHost/map.json b/src/Microsoft.PowerShell.ConsoleHost/map.json index 293e288db..472b2f6e6 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/map.json +++ b/src/Microsoft.PowerShell.ConsoleHost/map.json @@ -30,5 +30,5 @@ "monad/src/host/msh/resources/ManagedEntranceStrings.resx": "resources/ManagedEntranceStrings.resx", "monad/src/singleshell/installer/EngineInstaller.cs": "singleshell/installer/EngineInstaller.cs", "monad/src/host/msh/ConsoleHostRawUserInterface.cs": "host/msh/ConsoleHostRawUserInterface.cs", - "monad/src/host/msh/ConsoleHost.cs": "host/msh/ConsoleHost.cs", + "monad/src/host/msh/ConsoleHost.cs": "host/msh/ConsoleHost.cs" } diff --git a/src/Microsoft.PowerShell.ConsoleHost/project.json b/src/Microsoft.PowerShell.ConsoleHost/project.json index f79fb421f..054135941 100644 --- a/src/Microsoft.PowerShell.ConsoleHost/project.json +++ b/src/Microsoft.PowerShell.ConsoleHost/project.json @@ -10,9 +10,18 @@ "warningsAsErrors": true, "allowUnsafe": true, "copyToOutput": { - "include": [ - "Modules", - "../Modules", + "mappings": { + "Modules/" : { + "include": [ + "../Modules/Full", + "../Modules/Shared" + ], + "exclude": [ + "../Modules/Shared/Pester/.git*" + ] + } + }, + "include" : [ "powershell.exe", "../../powershell.version" ] @@ -20,14 +29,20 @@ }, "publishOptions": { - "include": [ - "Modules", - "../Modules", + "mappings": { + "Modules/" : { + "include": [ + "../Modules/Full", + "../Modules/Shared" + ], + "exclude": [ + "../Modules/Shared/Pester/.git*" + ] + } + }, + "include" : [ "powershell.exe", "../../powershell.version" - ], - "exclude": [ - "../Modules/Pester/.git" ] }, diff --git a/src/powershell/Modules/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 b/src/Modules/Core/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 similarity index 100% rename from src/powershell/Modules/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 rename to src/Modules/Core/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 diff --git a/src/powershell/Modules/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 b/src/Modules/Core/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 similarity index 100% rename from src/powershell/Modules/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 rename to src/Modules/Core/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 diff --git a/src/powershell/Modules/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 b/src/Modules/Core/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 similarity index 100% rename from src/powershell/Modules/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 rename to src/Modules/Core/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 diff --git a/src/powershell/Modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 b/src/Modules/Core/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 similarity index 100% rename from src/powershell/Modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 rename to src/Modules/Core/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 diff --git a/src/powershell/Modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1 b/src/Modules/Core/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1 similarity index 100% rename from src/powershell/Modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1 rename to src/Modules/Core/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1 diff --git a/src/Modules/PSDiagnostics/PSDiagnostics.psd1 b/src/Modules/Core/PSDiagnostics/PSDiagnostics.psd1 similarity index 100% rename from src/Modules/PSDiagnostics/PSDiagnostics.psd1 rename to src/Modules/Core/PSDiagnostics/PSDiagnostics.psd1 diff --git a/src/powershell/Modules/PSDiagnostics/PSDiagnostics.psm1 b/src/Modules/Core/PSDiagnostics/PSDiagnostics.psm1 similarity index 100% rename from src/powershell/Modules/PSDiagnostics/PSDiagnostics.psm1 rename to src/Modules/Core/PSDiagnostics/PSDiagnostics.psm1 diff --git a/src/Modules/Full/Microsoft.PowerShell.Diagnostics/Diagnostics.format.ps1xml b/src/Modules/Full/Microsoft.PowerShell.Diagnostics/Diagnostics.format.ps1xml new file mode 100644 index 000000000..6c6fc81f1 Binary files /dev/null and b/src/Modules/Full/Microsoft.PowerShell.Diagnostics/Diagnostics.format.ps1xml differ diff --git a/src/Modules/Full/Microsoft.PowerShell.Diagnostics/Event.format.ps1xml b/src/Modules/Full/Microsoft.PowerShell.Diagnostics/Event.format.ps1xml new file mode 100644 index 000000000..1b8f45b06 Binary files /dev/null and b/src/Modules/Full/Microsoft.PowerShell.Diagnostics/Event.format.ps1xml differ diff --git a/src/Modules/Full/Microsoft.PowerShell.Diagnostics/GetEvent.types.ps1xml b/src/Modules/Full/Microsoft.PowerShell.Diagnostics/GetEvent.types.ps1xml new file mode 100644 index 000000000..5a5731b8b Binary files /dev/null and b/src/Modules/Full/Microsoft.PowerShell.Diagnostics/GetEvent.types.ps1xml differ diff --git a/src/Microsoft.PowerShell.ConsoleHost/Modules/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 b/src/Modules/Full/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 similarity index 100% rename from src/Microsoft.PowerShell.ConsoleHost/Modules/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 rename to src/Modules/Full/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 diff --git a/src/Microsoft.PowerShell.ConsoleHost/Modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 b/src/Modules/Full/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 similarity index 100% rename from src/Microsoft.PowerShell.ConsoleHost/Modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 rename to src/Modules/Full/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1 diff --git a/src/Microsoft.PowerShell.ConsoleHost/Modules/PSScheduledJob/PSScheduledJob.Format.ps1xml b/src/Modules/Full/PSScheduledJob/PSScheduledJob.Format.ps1xml similarity index 100% rename from src/Microsoft.PowerShell.ConsoleHost/Modules/PSScheduledJob/PSScheduledJob.Format.ps1xml rename to src/Modules/Full/PSScheduledJob/PSScheduledJob.Format.ps1xml diff --git a/src/Microsoft.PowerShell.ConsoleHost/Modules/PSScheduledJob/PSScheduledJob.psd1 b/src/Modules/Full/PSScheduledJob/PSScheduledJob.psd1 similarity index 100% rename from src/Microsoft.PowerShell.ConsoleHost/Modules/PSScheduledJob/PSScheduledJob.psd1 rename to src/Modules/Full/PSScheduledJob/PSScheduledJob.psd1 diff --git a/src/Microsoft.PowerShell.ConsoleHost/Modules/PSScheduledJob/PSScheduledJob.types.ps1xml b/src/Modules/Full/PSScheduledJob/PSScheduledJob.types.ps1xml similarity index 100% rename from src/Microsoft.PowerShell.ConsoleHost/Modules/PSScheduledJob/PSScheduledJob.types.ps1xml rename to src/Modules/Full/PSScheduledJob/PSScheduledJob.types.ps1xml diff --git a/src/Microsoft.PowerShell.ConsoleHost/Modules/PSWorkflow/PSWorkflow.psd1 b/src/Modules/Full/PSWorkflow/PSWorkflow.psd1 similarity index 100% rename from src/Microsoft.PowerShell.ConsoleHost/Modules/PSWorkflow/PSWorkflow.psd1 rename to src/Modules/Full/PSWorkflow/PSWorkflow.psd1 diff --git a/src/Microsoft.PowerShell.ConsoleHost/Modules/PSWorkflow/PSWorkflow.psm1 b/src/Modules/Full/PSWorkflow/PSWorkflow.psm1 similarity index 100% rename from src/Microsoft.PowerShell.ConsoleHost/Modules/PSWorkflow/PSWorkflow.psm1 rename to src/Modules/Full/PSWorkflow/PSWorkflow.psm1 diff --git a/src/Microsoft.PowerShell.ConsoleHost/Modules/PSWorkflow/PSWorkflow.types.ps1xml b/src/Modules/Full/PSWorkflow/PSWorkflow.types.ps1xml similarity index 100% rename from src/Microsoft.PowerShell.ConsoleHost/Modules/PSWorkflow/PSWorkflow.types.ps1xml rename to src/Modules/Full/PSWorkflow/PSWorkflow.types.ps1xml diff --git a/src/Microsoft.PowerShell.ConsoleHost/Modules/PSWorkflowUtility/PSWorkflowUtility.psd1 b/src/Modules/Full/PSWorkflowUtility/PSWorkflowUtility.psd1 similarity index 100% rename from src/Microsoft.PowerShell.ConsoleHost/Modules/PSWorkflowUtility/PSWorkflowUtility.psd1 rename to src/Modules/Full/PSWorkflowUtility/PSWorkflowUtility.psd1 diff --git a/src/Microsoft.PowerShell.ConsoleHost/Modules/PSWorkflowUtility/PSWorkflowUtility.psm1 b/src/Modules/Full/PSWorkflowUtility/PSWorkflowUtility.psm1 similarity index 100% rename from src/Microsoft.PowerShell.ConsoleHost/Modules/PSWorkflowUtility/PSWorkflowUtility.psm1 rename to src/Modules/Full/PSWorkflowUtility/PSWorkflowUtility.psm1 diff --git a/src/Modules/README.md b/src/Modules/README.md new file mode 100644 index 000000000..500a406e2 --- /dev/null +++ b/src/Modules/README.md @@ -0,0 +1,25 @@ +Modules +========== + +There are 3 directories with **content** files. +Content files includes: + +- ps1xml +- psm1 +- psd1 +- ps1 + +These files are copied as-is by `dotnet` + +- **Shared** is shared between all flavours +- **Full** for FullCLR (Windows) +- **Core** for CoreCLR (all platforms) + +Notes +----------- + +* We have files with the same names in "Full" and "Core" folders. +That means that the contents of these two files are different. +I.e. if it's .psd1 file, it could be because `CmdletsToExport` are different for different platforms. + +* Also, we should never have files with the same names under "Full" and "Shared" (or "Core" and "Shared"). diff --git a/src/Modules/AppxProvider/AppxProvider.Resource.psd1 b/src/Modules/Shared/AppxProvider/AppxProvider.Resource.psd1 similarity index 100% rename from src/Modules/AppxProvider/AppxProvider.Resource.psd1 rename to src/Modules/Shared/AppxProvider/AppxProvider.Resource.psd1 diff --git a/src/Modules/AppxProvider/AppxProvider.psd1 b/src/Modules/Shared/AppxProvider/AppxProvider.psd1 similarity index 100% rename from src/Modules/AppxProvider/AppxProvider.psd1 rename to src/Modules/Shared/AppxProvider/AppxProvider.psd1 diff --git a/src/Modules/AppxProvider/AppxProvider.psm1 b/src/Modules/Shared/AppxProvider/AppxProvider.psm1 similarity index 100% rename from src/Modules/AppxProvider/AppxProvider.psm1 rename to src/Modules/Shared/AppxProvider/AppxProvider.psm1 diff --git a/src/Modules/CimCmdlets/CimCmdlets.psd1 b/src/Modules/Shared/CimCmdlets/CimCmdlets.psd1 similarity index 100% rename from src/Modules/CimCmdlets/CimCmdlets.psd1 rename to src/Modules/Shared/CimCmdlets/CimCmdlets.psd1 diff --git a/src/Modules/Microsoft.PowerShell.Archive/ArchiveResources.psd1 b/src/Modules/Shared/Microsoft.PowerShell.Archive/ArchiveResources.psd1 similarity index 100% rename from src/Modules/Microsoft.PowerShell.Archive/ArchiveResources.psd1 rename to src/Modules/Shared/Microsoft.PowerShell.Archive/ArchiveResources.psd1 diff --git a/src/Modules/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psd1 b/src/Modules/Shared/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psd1 similarity index 100% rename from src/Modules/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psd1 rename to src/Modules/Shared/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psd1 diff --git a/src/Modules/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1 b/src/Modules/Shared/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1 similarity index 100% rename from src/Modules/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1 rename to src/Modules/Shared/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1 diff --git a/src/Modules/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1 b/src/Modules/Shared/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1 similarity index 100% rename from src/Modules/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1 rename to src/Modules/Shared/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1 diff --git a/src/Modules/Microsoft.PowerShell.LocalAccounts/LocalAccounts.format.ps1xml b/src/Modules/Shared/Microsoft.PowerShell.LocalAccounts/LocalAccounts.format.ps1xml similarity index 100% rename from src/Modules/Microsoft.PowerShell.LocalAccounts/LocalAccounts.format.ps1xml rename to src/Modules/Shared/Microsoft.PowerShell.LocalAccounts/LocalAccounts.format.ps1xml diff --git a/src/Modules/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.psd1 b/src/Modules/Shared/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.psd1 similarity index 100% rename from src/Modules/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.psd1 rename to src/Modules/Shared/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.psd1 diff --git a/src/Modules/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 b/src/Modules/Shared/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 similarity index 100% rename from src/Modules/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 rename to src/Modules/Shared/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1 diff --git a/src/Modules/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataAdapter.ps1 b/src/Modules/Shared/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataAdapter.ps1 similarity index 100% rename from src/Modules/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataAdapter.ps1 rename to src/Modules/Shared/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataAdapter.ps1 diff --git a/src/Modules/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psd1 b/src/Modules/Shared/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psd1 similarity index 100% rename from src/Modules/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psd1 rename to src/Modules/Shared/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psd1 diff --git a/src/Modules/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psm1 b/src/Modules/Shared/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psm1 similarity index 100% rename from src/Modules/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psm1 rename to src/Modules/Shared/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psm1 diff --git a/src/Modules/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtilsHelper.ps1 b/src/Modules/Shared/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtilsHelper.ps1 similarity index 100% rename from src/Modules/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtilsHelper.ps1 rename to src/Modules/Shared/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtilsHelper.ps1 diff --git a/src/Modules/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataV4Adapter.ps1 b/src/Modules/Shared/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataV4Adapter.ps1 similarity index 100% rename from src/Modules/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataV4Adapter.ps1 rename to src/Modules/Shared/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataV4Adapter.ps1 diff --git a/src/Modules/Microsoft.PowerShell.ODataUtils/en-US/Microsoft.PowerShell.ODataUtilsStrings.psd1 b/src/Modules/Shared/Microsoft.PowerShell.ODataUtils/en-US/Microsoft.PowerShell.ODataUtilsStrings.psd1 similarity index 100% rename from src/Modules/Microsoft.PowerShell.ODataUtils/en-US/Microsoft.PowerShell.ODataUtilsStrings.psd1 rename to src/Modules/Shared/Microsoft.PowerShell.ODataUtils/en-US/Microsoft.PowerShell.ODataUtilsStrings.psd1 diff --git a/src/Modules/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 b/src/Modules/Shared/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 similarity index 100% rename from src/Modules/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 rename to src/Modules/Shared/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1 diff --git a/src/Modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1 b/src/Modules/Shared/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1 similarity index 100% rename from src/Modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1 rename to src/Modules/Shared/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1 diff --git a/src/Modules/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 b/src/Modules/Shared/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 similarity index 92% rename from src/Modules/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 rename to src/Modules/Shared/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 index b66b28217..972d36886 100644 --- a/src/Modules/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 +++ b/src/Modules/Shared/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1 @@ -10,5 +10,6 @@ AliasesToExport = @() FunctionsToExport = @() CmdletsToExport="Disable-WSManCredSSP", "Enable-WSManCredSSP", "Get-WSManCredSSP", "Set-WSManQuickConfig", "Test-WSMan", "Invoke-WSManAction", "Connect-WSMan", "Disconnect-WSMan", "Get-WSManInstance", "Set-WSManInstance", "Remove-WSManInstance", "New-WSManInstance", "New-WSManSessionOption" NestedModules="Microsoft.WSMan.Management.dll" +FormatsToProcess="WSMan.format.ps1xml" HelpInfoURI = 'http://go.microsoft.com/fwlink/?linkid=390788' } diff --git a/src/Modules/Shared/Microsoft.WSMan.Management/WSMan.format.ps1xml b/src/Modules/Shared/Microsoft.WSMan.Management/WSMan.format.ps1xml new file mode 100644 index 000000000..8e34497aa Binary files /dev/null and b/src/Modules/Shared/Microsoft.WSMan.Management/WSMan.format.ps1xml differ diff --git a/src/powershell/Modules/PSDiagnostics/PSDiagnostics.psd1 b/src/Modules/Shared/PSDiagnostics/PSDiagnostics.psd1 similarity index 100% rename from src/powershell/Modules/PSDiagnostics/PSDiagnostics.psd1 rename to src/Modules/Shared/PSDiagnostics/PSDiagnostics.psd1 diff --git a/src/Modules/PSDiagnostics/PSDiagnostics.psm1 b/src/Modules/Shared/PSDiagnostics/PSDiagnostics.psm1 similarity index 100% rename from src/Modules/PSDiagnostics/PSDiagnostics.psm1 rename to src/Modules/Shared/PSDiagnostics/PSDiagnostics.psm1 diff --git a/src/Modules/PSReadLine/PSReadLine.psd1 b/src/Modules/Shared/PSReadLine/PSReadLine.psd1 similarity index 100% rename from src/Modules/PSReadLine/PSReadLine.psd1 rename to src/Modules/Shared/PSReadLine/PSReadLine.psd1 diff --git a/src/Modules/PSReadLine/PSReadLine.psm1 b/src/Modules/Shared/PSReadLine/PSReadLine.psm1 similarity index 100% rename from src/Modules/PSReadLine/PSReadLine.psm1 rename to src/Modules/Shared/PSReadLine/PSReadLine.psm1 diff --git a/src/Modules/PackageManagement/PackageManagement.format.ps1xml b/src/Modules/Shared/PackageManagement/PackageManagement.format.ps1xml similarity index 100% rename from src/Modules/PackageManagement/PackageManagement.format.ps1xml rename to src/Modules/Shared/PackageManagement/PackageManagement.format.ps1xml diff --git a/src/Modules/PackageManagement/PackageManagement.psd1 b/src/Modules/Shared/PackageManagement/PackageManagement.psd1 similarity index 100% rename from src/Modules/PackageManagement/PackageManagement.psd1 rename to src/Modules/Shared/PackageManagement/PackageManagement.psd1 diff --git a/src/Modules/PackageManagement/PackageProviderFunctions.psm1 b/src/Modules/Shared/PackageManagement/PackageProviderFunctions.psm1 similarity index 100% rename from src/Modules/PackageManagement/PackageProviderFunctions.psm1 rename to src/Modules/Shared/PackageManagement/PackageProviderFunctions.psm1 diff --git a/src/Modules/Pester b/src/Modules/Shared/Pester similarity index 100% rename from src/Modules/Pester rename to src/Modules/Shared/Pester diff --git a/src/Modules/PowerShellGet/PSGet.Format.ps1xml b/src/Modules/Shared/PowerShellGet/PSGet.Format.ps1xml similarity index 100% rename from src/Modules/PowerShellGet/PSGet.Format.ps1xml rename to src/Modules/Shared/PowerShellGet/PSGet.Format.ps1xml diff --git a/src/Modules/PowerShellGet/PSGet.Resource.psd1 b/src/Modules/Shared/PowerShellGet/PSGet.Resource.psd1 similarity index 100% rename from src/Modules/PowerShellGet/PSGet.Resource.psd1 rename to src/Modules/Shared/PowerShellGet/PSGet.Resource.psd1 diff --git a/src/Modules/PowerShellGet/PSModule.psm1 b/src/Modules/Shared/PowerShellGet/PSModule.psm1 similarity index 100% rename from src/Modules/PowerShellGet/PSModule.psm1 rename to src/Modules/Shared/PowerShellGet/PSModule.psm1 diff --git a/src/Modules/PowerShellGet/PowerShellGet.psd1 b/src/Modules/Shared/PowerShellGet/PowerShellGet.psd1 similarity index 100% rename from src/Modules/PowerShellGet/PowerShellGet.psd1 rename to src/Modules/Shared/PowerShellGet/PowerShellGet.psd1 diff --git a/src/Modules/map.json b/src/Modules/map.json index d2f5fe1de..1186cdb40 100644 --- a/src/Modules/map.json +++ b/src/Modules/map.json @@ -1,31 +1,49 @@ { - "monad/miscfiles/modules/PSDiagnostics/PSDiagnostics.psd1": "PSDiagnostics/PSDiagnostics.psd1", - "monad/miscfiles/modules/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1": "Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1", - "monad/miscfiles/modules/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1": "Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1", - "monad/miscfiles/modules/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1": "Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1", - "monad/miscfiles/modules/PSDiagnostics/PSDiagnostics.psm1": "PSDiagnostics/PSDiagnostics.psm1", - "monad/miscfiles/modules/AppxProvider/AppxProvider.psm1": "AppxProvider/AppxProvider.psm1", - "monad/miscfiles/modules/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psd1": "Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psd1", - "monad/miscfiles/modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1": "Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1", - "monad/miscfiles/modules/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1": "Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1", - "monad/miscfiles/modules/Microsoft.PowerShell.Archive/ArchiveResources.psd1": "Microsoft.PowerShell.Archive/ArchiveResources.psd1", - "monad/miscfiles/modules/PSGet/PSGet.psd1": "PowerShellGet/PowerShellGet.psd1", - "monad/miscfiles/modules/PSGet/PSModule.psm1": "PowerShellGet/PSModule.psm1", - "monad/miscfiles/modules/PSGet/PSGet.Format.ps1xml": "PowerShellGet/PSGet.Format.ps1xml", - "monad/miscfiles/modules/PSGet/PSGet.Resource.psd1": "PowerShellGet/PSGet.Resource.psd1", - "monad/miscfiles/modules/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1": "Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1", - "monad/miscfiles/modules/AppxProvider/AppxProvider.Resource.psd1": "AppxProvider/AppxProvider.Resource.psd1", - "monad/miscfiles/modules/AppxProvider/AppxProvider.psd1": "AppxProvider/AppxProvider.psd1", - "monad/src/LocalAccounts/Microsoft.PowerShell.LocalAccounts.psd1": "Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.psd1", - "monad/src/LocalAccounts/LocalAccounts.format.ps1xml": "Microsoft.PowerShell.LocalAccounts/LocalAccounts.format.ps1xml", - "monad/src/oneget/PowerShell.Module/PackageManagement.psd1": "PackageManagement/PackageManagement.psd1", - "monad/src/oneget/PowerShell.Module/PackageManagement.format.ps1xml": "PackageManagement/PackageManagement.format.ps1xml", - "monad/src/oneget/providers/inbox/powershell.metaprovider/PackageProviderFunctions.psm1": "PackageManagement/PackageProviderFunctions.psm1", - "wmi/psws/PSODataUtils/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataAdapter.ps1": "Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataAdapter.ps1", - "wmi/psws/PSODataUtils/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psd1": "Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psd1", - "wmi/psws/PSODataUtils/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psm1": "Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psm1", - "wmi/psws/PSODataUtils/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtilsHelper.ps1": "Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtilsHelper.ps1", - "wmi/psws/PSODataUtils/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataV4Adapter.ps1": "Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataV4Adapter.ps1", - "wmi/psws/PSODataUtils/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtilsStrings.psd1": "Microsoft.PowerShell.ODataUtils/en-US/Microsoft.PowerShell.ODataUtilsStrings.psd1", - "wmi/WMIv2/Client/CIMCmdlets/CimCmdlets.psd1" : "CimCmdlets/CimCmdlets.psd1" + "monad/miscfiles/modules/PSDiagnostics/PSDiagnostics.psd1": "Shared/PSDiagnostics/PSDiagnostics.psd1", + "monad/miscfiles/modules/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1": "Shared/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psm1", + "monad/miscfiles/modules/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1": "Shared/Microsoft.PowerShell.Management/Microsoft.PowerShell.Management.psd1", + "monad/miscfiles/modules/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1": "Shared/Microsoft.WSMan.Management/Microsoft.WSMan.Management.psd1", + "monad/miscfiles/display/WSMan.format.ps1xml": "Shared/Microsoft.WSMan.Management/WSMan.format.ps1xml", + "monad/miscfiles/modules/PSDiagnostics/PSDiagnostics.psm1": "Shared/PSDiagnostics/PSDiagnostics.psm1", + "monad/miscfiles/modules/AppxProvider/AppxProvider.psm1": "Shared/AppxProvider/AppxProvider.psm1", + "monad/miscfiles/modules/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psd1": "Shared/Microsoft.PowerShell.Archive/Microsoft.PowerShell.Archive.psd1", + "monad/miscfiles/modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1": "Shared/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psm1", + "monad/miscfiles/modules/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1": "Shared/Microsoft.PowerShell.Security/Microsoft.PowerShell.Security.psd1", + "monad/miscfiles/modules/Microsoft.PowerShell.Archive/ArchiveResources.psd1": "Shared/Microsoft.PowerShell.Archive/ArchiveResources.psd1", + "monad/miscfiles/modules/PSGet/PSGet.psd1": "Shared/PowerShellGet/PowerShellGet.psd1", + "monad/miscfiles/modules/PSGet/PSModule.psm1": "Shared/PowerShellGet/PSModule.psm1", + "monad/miscfiles/modules/PSGet/PSGet.Format.ps1xml": "Shared/PowerShellGet/PSGet.Format.ps1xml", + "monad/miscfiles/modules/PSGet/PSGet.Resource.psd1": "Shared/PowerShellGet/PSGet.Resource.psd1", + "monad/miscfiles/modules/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1": "Shared/Microsoft.PowerShell.Host/Microsoft.PowerShell.Host.psd1", + "monad/miscfiles/modules/AppxProvider/AppxProvider.Resource.psd1": "Shared/AppxProvider/AppxProvider.Resource.psd1", + "monad/miscfiles/modules/AppxProvider/AppxProvider.psd1": "Shared/AppxProvider/AppxProvider.psd1", + "monad/src/LocalAccounts/Microsoft.PowerShell.LocalAccounts.psd1": "Shared/Microsoft.PowerShell.LocalAccounts/Microsoft.PowerShell.LocalAccounts.psd1", + "monad/src/LocalAccounts/LocalAccounts.format.ps1xml": "Shared/Microsoft.PowerShell.LocalAccounts/LocalAccounts.format.ps1xml", + "monad/src/oneget/PowerShell.Module/PackageManagement.psd1": "Shared/PackageManagement/PackageManagement.psd1", + "monad/src/oneget/PowerShell.Module/PackageManagement.format.ps1xml": "Shared/PackageManagement/PackageManagement.format.ps1xml", + "monad/src/oneget/providers/inbox/powershell.metaprovider/PackageProviderFunctions.psm1": "Shared/PackageManagement/PackageProviderFunctions.psm1", + "wmi/psws/PSODataUtils/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataAdapter.ps1": "Shared/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataAdapter.ps1", + "wmi/psws/PSODataUtils/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psd1": "Shared/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psd1", + "wmi/psws/PSODataUtils/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psm1": "Shared/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtils.psm1", + "wmi/psws/PSODataUtils/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtilsHelper.ps1": "Shared/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtilsHelper.ps1", + "wmi/psws/PSODataUtils/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataV4Adapter.ps1": "Shared/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataV4Adapter.ps1", + "wmi/psws/PSODataUtils/Microsoft.PowerShell.ODataUtils/Microsoft.PowerShell.ODataUtilsStrings.psd1": "Shared/Microsoft.PowerShell.ODataUtils/en-US/Microsoft.PowerShell.ODataUtilsStrings.psd1", + "wmi/WMIv2/Client/CIMCmdlets/CimCmdlets.psd1": "Shared/CimCmdlets/CimCmdlets.psd1", + + "monad/miscfiles/modules/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1": "Full/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1", + "monad/miscfiles/types/getevent.types.ps1xml": "Full/Microsoft.PowerShell.Diagnostics/GetEvent.types.ps1xml", + "monad/miscfiles/display/Event.format.ps1xml": "Full/Microsoft.PowerShell.Diagnostics/Event.format.ps1xml", + "monad/miscfiles/display/Diagnostics.format.ps1xml": "Full/Microsoft.PowerShell.Diagnostics/Diagnostics.format.ps1xml", + "monad/miscfiles/modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1": "Full/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1", + "monad/src/ScheduledJob/PSScheduledJob.Format.ps1xml": "Full/PSScheduledJob/PSScheduledJob.Format.ps1xml", + "monad/src/ScheduledJob/PSScheduledJob.psd1": "Full/PSScheduledJob/PSScheduledJob.psd1", + "monad/src/ScheduledJob/PSScheduledJob.types.ps1xml": "Full/PSScheduledJob/PSScheduledJob.types.ps1xml", + "monad/src/m3p/product/PSWorkflow.psd1": "Full/PSWorkflow/PSWorkflow.psd1", + "monad/src/m3p/product/PSWorkflow.psm1": "Full/PSWorkflow/PSWorkflow.psm1", + "monad/src/m3p/product/PSWorkflow.types.ps1xml": "Full/PSWorkflow/PSWorkflow.types.ps1xml", + "monad/src/m3p/product/PSWorkflowUtility.psd1": "Full/PSWorkflowUtility/PSWorkflowUtility.psd1", + "monad/src/m3p/product/PSWorkflowUtility.psm1": "Full/PSWorkflowUtility/PSWorkflowUtility.psm1", + + "monad/miscfiles/modules/Microsoft.PowerShell.Diagnostics/CoreClr/Microsoft.PowerShell.Diagnostics.psd1": "Core/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1", + "monad/miscfiles/modules/Microsoft.PowerShell.Utility/CoreClr/Microsoft.PowerShell.Utility.psd1": "Core/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1" } diff --git a/src/powershell/map.json b/src/powershell/map.json deleted file mode 100644 index bde38359e..000000000 --- a/src/powershell/map.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "monad/miscfiles/modules/Microsoft.PowerShell.Diagnostics/CoreClr/Microsoft.PowerShell.Diagnostics.psd1": "Modules/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1", - "monad/miscfiles/modules/Microsoft.PowerShell.Utility/CoreClr/Microsoft.PowerShell.Utility.psd1": "Modules/Microsoft.PowerShell.Utility/Microsoft.PowerShell.Utility.psd1" -} diff --git a/src/powershell/project.json b/src/powershell/project.json index d2c95ad0d..603f316c7 100644 --- a/src/powershell/project.json +++ b/src/powershell/project.json @@ -8,9 +8,18 @@ "allowUnsafe": true, "emitEntryPoint": true, "copyToOutput": { + "mappings": { + "Modules/" : { + "include": [ + "../Modules/Core", + "../Modules/Shared" + ], + "exclude": [ + "../Modules/Shared/Pester/.git*" + ] + } + }, "include": [ - "Modules", - "../Modules", "*.so", "*.dylib", "../../powershell.version" @@ -19,16 +28,22 @@ }, "publishOptions": { + "mappings": { + "Modules/" : { + "include": [ + "../Modules/Core", + "../Modules/Shared" + ], + "exclude": [ + "../Modules/Shared/Pester/.git*" + ] + } + }, "include": [ - "Modules", - "../Modules", "*.so", "*.dylib", "../../powershell.version" ], - "exclude": [ - "../Modules/Pester/.git" - ] }, "dependencies": { diff --git a/test/fullclr/PowerShellGithubDev.Tests.ps1 b/test/fullclr/PowerShellGithubDev.Tests.ps1 index 9e3601735..2868d2b44 100644 --- a/test/fullclr/PowerShellGithubDev.Tests.ps1 +++ b/test/fullclr/PowerShellGithubDev.Tests.ps1 @@ -115,13 +115,27 @@ try try { Import-Module CimCmdlets -ErrorAction Stop - Get-CimClass | Should Not Be $null + Get-CimClass -ClassName CIM_Error | Should Not Be $null } finally { Remove-Module -ErrorAction SilentlyContinue CimCmdlets } } + + It 'loads Microsoft.PowerShell.Diagnostics' { + try + { + Import-Module Microsoft.PowerShell.Diagnostics -ErrorAction Stop + Get-WinEvent -LogName System -MaxEvents 1 | Should Not Be $null + [Microsoft.PowerShell.Commands.GetWinEventCommand].Assembly.Location | Should Be ( + Join-Path $env:DEVPATH Microsoft.PowerShell.Commands.Diagnostics.dll) + } + finally + { + Remove-Module -ErrorAction SilentlyContinue Microsoft.PowerShell.Diagnostics + } + } } } diff --git a/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-WinEvent.Tests.ps1 b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-WinEvent.Tests.ps1 new file mode 100644 index 000000000..fc438e94b --- /dev/null +++ b/test/powershell/Modules/Microsoft.PowerShell.Diagnostics/Get-WinEvent.Tests.ps1 @@ -0,0 +1,7 @@ +Describe 'Get-WinEvent' { + + # Get-WinEvent works only on windows + It 'can query a System log' -Skip:(-not $IsWindows) { + Get-WinEvent -LogName System -MaxEvents 1 | Should Not Be $null + } +}