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

Import-module is very slow, take from 7-16 seconds #35

Closed
McAndersDK opened this issue Aug 15, 2017 · 18 comments
Closed

Import-module is very slow, take from 7-16 seconds #35

McAndersDK opened this issue Aug 15, 2017 · 18 comments
Milestone

Comments

@McAndersDK
Copy link
Contributor

@McAndersDK McAndersDK commented Aug 15, 2017

Resolutions:

  • Merge all functions into the PSM1 file at build time.
    • This step alone could remove atleast 6 seconds from the load time.
  • split the module to smaller modules, with one "Umbrella" module for all.
@splatteredbits
Copy link
Member

@splatteredbits splatteredbits commented Dec 13, 2017

I added some timings to the Carbon.psm1 file and it turns out the entire import time is taken up by checking if the Win32_OptionalFeature is installed, about 19 seconds in this attempt. Dot-sourcing all the function files only takes a second.

DEBUG: [12/13/2017 1:29:10 AM]  [00:00:00.0019996]  BEGIN
DEBUG: [12/13/2017 1:29:10 AM]  [00:00:00.0159968]  After include functions needed.
DEBUG: [12/13/2017 1:29:10 AM]  [00:00:00.0199960]  Adding System.Security assembly.
DEBUG: [12/13/2017 1:29:10 AM]  [00:00:00.0289942]  Adding Ionic.Zip assembly.
DEBUG: [12/13/2017 1:29:10 AM]  [00:00:00.0449910]  Adding System.Web assembly.
DEBUG: [12/13/2017 1:29:10 AM]  [00:00:00.0559888]  Adding Microsoft.Web.Administration assembly.
DEBUG: [12/13/2017 1:29:10 AM]  [00:00:00.0669866]  Adding Carbon.Iis assembly.
DEBUG: [12/13/2017 1:29:10 AM]  [00:00:00.1079784]  Updating Microsoft.Web.Administration.Site type data.
DEBUG: [12/13/2017 1:29:10 AM]  [00:00:00.1139772]  Updating Microsoft.Web.Administration.Application type data.
DEBUG: [12/13/2017 1:29:10 AM]  [00:00:00.1149770]  Adding System.ServiceProcess assembly.
DEBUG: [12/13/2017 1:29:10 AM]  [00:00:00.1189762]  Adding System.Messaging assembly.
DEBUG: [12/13/2017 1:29:10 AM]  [00:00:00.1259748]  Adding System.ServiceProcess assembly.
DEBUG: [12/13/2017 1:29:10 AM]  [00:00:00.1279744]  Adding System.DirectoryServices.AccountManagement assembly.
DEBUG: [12/13/2017 1:29:10 AM]  [00:00:00.1369726]  Checking if servermanagercmd.exe exists.
DEBUG: [12/13/2017 1:29:10 AM]  [00:00:00.1699660]  Checking if Win32_OptionalFeature WMI class is available.
DEBUG: [12/13/2017 1:29:30 AM]  [00:00:19.8730246]  Checking if ocsetup.exe exists.
DEBUG: [12/13/2017 1:29:30 AM]  [00:00:19.9090174]  Updating System.IO.FileInfo type data (GetCarbonFileInfo).
DEBUG: [12/13/2017 1:29:30 AM]  [00:00:19.9150162]  Updating System.IO.FileInfo type data (FileIndex).
DEBUG: [12/13/2017 1:29:30 AM]  [00:00:19.9230146]  Updating System.IO.FileInfo type data (LinkCount).
DEBUG: [12/13/2017 1:29:30 AM]  [00:00:19.9290134]  Updating System.IO.FileInfo type data (ColumeSerialNumber).
DEBUG: [12/13/2017 1:29:30 AM]  [00:00:19.9300132]  Dot-sourcing functions.
DEBUG: [12/13/2017 1:29:31 AM]  [00:00:20.9948002]  Testing the module manifest.
DEBUG: [12/13/2017 1:29:31 AM]  [00:00:21.0157960]  Exporting module members.
DEBUG: [12/13/2017 1:29:31 AM]  [00:00:21.0357920]  DONE
splatteredbits added a commit that referenced this issue Dec 13, 2017
@splatteredbits splatteredbits modified the milestones: 2.5.1, 2.6.0 Dec 13, 2017
@McAndersDK
Copy link
Contributor Author

@McAndersDK McAndersDK commented Apr 17, 2018

Hey again,
I added your logging and ran it here:

DEBUG: [17-04-2018 10:06:12]  [00:00:00.0009997]  BEGIN
DEBUG: [17-04-2018 10:06:12]  [00:00:00.0040407]  Dot-sourcing Test-TypeDataMember.
DEBUG: [17-04-2018 10:06:12]  [00:00:00.0626084]  Dot-sourcing Use-CallerPreference.
DEBUG: [17-04-2018 10:06:12]  [00:00:00.1227680]  Adding System.Security assembly.
DEBUG: [17-04-2018 10:06:12]  [00:00:00.1262667]  Adding Ionic.Zip assembly.
DEBUG: [17-04-2018 10:06:12]  [00:00:00.1463303]  Adding System.Web assembly.
DEBUG: [17-04-2018 10:06:12]  [00:00:00.1628542]  Filtering out IIS functions.
DEBUG: [17-04-2018 10:06:12]  [00:00:00.1934125]  Adding System.ServiceProcess assembly.
DEBUG: [17-04-2018 10:06:12]  [00:00:00.1994377]  Adding System.Messaging assembly.
DEBUG: [17-04-2018 10:06:12]  [00:00:00.2094378]  Adding System.ServiceProcess assembly.
DEBUG: [17-04-2018 10:06:12]  [00:00:00.2134410]  Adding System.DirectoryServices.AccountManagement assembly.
DEBUG: [17-04-2018 10:06:12]  [00:00:00.2289758]  Checking if servermanagercmd.exe exists.
DEBUG: [17-04-2018 10:06:12]  [00:00:00.4117598]  Checking if Win32_OptionalFeature WMI class is available.
DEBUG: [17-04-2018 10:06:12]  [00:00:00.4292826]  Checking if ocsetup.exe exists.
DEBUG: [17-04-2018 10:06:13]  [00:00:00.6706978]  Dot-sourcing functions.
DEBUG: [17-04-2018 10:06:23]  [00:00:10.8882345]  Testing the module manifest.
DEBUG: [17-04-2018 10:06:23]  [00:00:10.9173477]  Exporting module members.
DEBUG: [17-04-2018 10:06:23]  [00:00:10.9468984]  DONE

as you can see the dot-sourcing is the slowdown here.

@McAndersDK
Copy link
Contributor Author

@McAndersDK McAndersDK commented Apr 17, 2018

And here for the complete log with timestamps on the dot sourcing:

DEBUG: [17-04-2018 10:11:54]  [00:00:00.0004975]  BEGIN
DEBUG: [17-04-2018 10:11:54]  [00:00:00.0030024]  Dot-sourcing Test-TypeDataMember.
DEBUG: [17-04-2018 10:11:54]  [00:00:00.0575747]  Dot-sourcing Use-CallerPreference.
DEBUG: [17-04-2018 10:11:54]  [00:00:00.1171577]  Adding System.Security assembly.
DEBUG: [17-04-2018 10:11:54]  [00:00:00.1206646]  Adding Ionic.Zip assembly.
DEBUG: [17-04-2018 10:11:54]  [00:00:00.1386842]  Adding System.Web assembly.
DEBUG: [17-04-2018 10:11:54]  [00:00:00.1441860]  Filtering out IIS functions.
DEBUG: [17-04-2018 10:11:54]  [00:00:00.1782464]  Adding System.ServiceProcess assembly.
DEBUG: [17-04-2018 10:11:54]  [00:00:00.1882580]  Adding System.Messaging assembly.
DEBUG: [17-04-2018 10:11:54]  [00:00:00.1982972]  Adding System.ServiceProcess assembly.
DEBUG: [17-04-2018 10:11:54]  [00:00:00.2067935]  Adding System.DirectoryServices.AccountManagement assembly.
DEBUG: [17-04-2018 10:11:54]  [00:00:00.2123222]  Checking if servermanagercmd.exe exists.
DEBUG: [17-04-2018 10:11:55]  [00:00:00.4070303]  Checking if Win32_OptionalFeature WMI class is available.
DEBUG: [17-04-2018 10:11:55]  [00:00:00.4265548]  Checking if ocsetup.exe exists.
DEBUG: [17-04-2018 10:11:55]  [00:00:00.6704033]  Dot-sourcing functions.
DEBUG: [17-04-2018 10:11:55]  [00:00:00.6799261]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Add-GroupMember.ps1.
DEBUG: [17-04-2018 10:11:55]  [00:00:00.7460259]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Add-TrustedHost.ps1.
DEBUG: [17-04-2018 10:11:55]  [00:00:00.8060914]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Assert-AdminPrivilege.ps1.
DEBUG: [17-04-2018 10:11:55]  [00:00:00.8681734]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Assert-FirewallConfigurable.ps1.
DEBUG: [17-04-2018 10:11:55]  [00:00:00.9287410]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Assert-Service.ps1.
DEBUG: [17-04-2018 10:11:55]  [00:00:00.9848131]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Assert-WindowsFeatureFunctionsSupported.ps1.
DEBUG: [17-04-2018 10:11:55]  [00:00:01.0428690]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Clear-DscLocalResourceCache.ps1.
DEBUG: [17-04-2018 10:11:55]  [00:00:01.0994591]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Clear-MofAuthoringMetadata.ps1.
DEBUG: [17-04-2018 10:11:55]  [00:00:01.1555284]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Clear-TrustedHost.ps1.
DEBUG: [17-04-2018 10:11:55]  [00:00:01.2136215]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Complete-Job.ps1.
DEBUG: [17-04-2018 10:11:55]  [00:00:01.2656781]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Compress-Item.ps1.
DEBUG: [17-04-2018 10:11:55]  [00:00:01.3232587]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Convert-SecureStringToString.ps1.
DEBUG: [17-04-2018 10:11:56]  [00:00:01.3893483]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Convert-XmlFile.ps1.
DEBUG: [17-04-2018 10:11:56]  [00:00:01.4554336]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\ConvertFrom-Base64.ps1.
DEBUG: [17-04-2018 10:11:56]  [00:00:01.5160217]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\ConvertTo-Base64.ps1.
DEBUG: [17-04-2018 10:11:56]  [00:00:01.5765838]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\ConvertTo-ContainerInheritanceFlags.ps1.
DEBUG: [17-04-2018 10:11:56]  [00:00:01.6316519]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\ConvertTo-InheritanceFlag.ps1.
DEBUG: [17-04-2018 10:11:56]  [00:00:01.6887414]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\ConvertTo-Key.ps1.
DEBUG: [17-04-2018 10:11:56]  [00:00:01.7453169]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\ConvertTo-PropagationFlag.ps1.
DEBUG: [17-04-2018 10:11:56]  [00:00:01.8003874]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\ConvertTo-ProviderAccessControlRights.ps1.
DEBUG: [17-04-2018 10:11:56]  [00:00:01.8739938]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\ConvertTo-SecurityIdentifier.ps1.
DEBUG: [17-04-2018 10:11:56]  [00:00:01.9295855]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Copy-DscResource.ps1.
DEBUG: [17-04-2018 10:11:56]  [00:00:01.9851459]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Disable-AclInheritance.ps1.
DEBUG: [17-04-2018 10:11:56]  [00:00:02.0442102]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Disable-FirewallStatefulFtp.ps1.
DEBUG: [17-04-2018 10:11:56]  [00:00:02.1007903]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Disable-IEEnhancedSecurityConfiguration.ps1.
DEBUG: [17-04-2018 10:11:56]  [00:00:02.1698764]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Disable-NtfsCompression.ps1.
DEBUG: [17-04-2018 10:11:56]  [00:00:02.2549765]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Enable-AclInheritance.ps1.
DEBUG: [17-04-2018 10:11:57]  [00:00:02.6537963]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Enable-FirewallStatefulFtp.ps1.
DEBUG: [17-04-2018 10:11:57]  [00:00:02.7824373]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Enable-IEActivationPermission.ps1.
DEBUG: [17-04-2018 10:11:57]  [00:00:02.8400306]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Enable-NtfsCompression.ps1.
DEBUG: [17-04-2018 10:11:57]  [00:00:02.9066223]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Expand-Item.ps1.
DEBUG: [17-04-2018 10:11:57]  [00:00:02.9762113]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Find-ADUser.ps1.
DEBUG: [17-04-2018 10:11:57]  [00:00:03.0272802]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Format-ADSearchFilterValue.ps1.
DEBUG: [17-04-2018 10:11:57]  [00:00:03.0778398]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-ADDomainController.ps1.
DEBUG: [17-04-2018 10:11:57]  [00:00:03.1339167]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-Certificate.ps1.
DEBUG: [17-04-2018 10:11:57]  [00:00:03.1914870]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-CertificateStore.ps1.
DEBUG: [17-04-2018 10:11:57]  [00:00:03.2520973]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-ComPermission.ps1.
DEBUG: [17-04-2018 10:11:57]  [00:00:03.3111611]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-ComSecurityDescriptor.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:03.3722625]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-DscError.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:03.4373469]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-DscWinEvent.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:03.5104263]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-FileShare.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:03.5670053]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-FileSharePermission.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:03.6285769]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-FirewallRule.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:03.6821531]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-Group.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:03.7407191]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-HttpUrlAcl.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:03.8002989]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-IdentityPrincipalContext.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:03.8634043]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-IPAddress.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:03.9194693]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-Msi.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:03.9765359]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-MsmqMessageQueue.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:04.0441197]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-MsmqMessageQueuePath.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:04.1112085]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-PathProvider.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:04.1662885]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-PathToHostsFile.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:04.2293899]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-PerformanceCounter.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:04.2864644]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-Permission.ps1.
DEBUG: [17-04-2018 10:11:58]  [00:00:04.3505575]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-PowerShellModuleInstallPath.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:04.4091310]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-PowershellPath.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:04.4596997]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-Privilege.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:04.5087919]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-ProgramInstallInfo.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:04.5567510]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-RegistryKeyValue.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:04.6108672]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-ScheduledTask.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:04.6587920]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-ServiceAcl.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:04.7059252]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-ServiceConfiguration.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:04.7591812]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-ServicePermission.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:04.8078091]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-ServiceSecurityDescriptor.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:04.8608764]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-SslCertificateBinding.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:04.9089950]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-TrustedHost.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:04.9601215]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-User.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:05.0087099]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-WindowsFeature.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:05.1383865]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Get-WmiLocalUserAccount.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:05.2109878]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Grant-ComPermission.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:05.2591052]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Grant-HttpUrlPermission.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:05.3069230]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Grant-MsmqMessageQueuePermission.ps1.
DEBUG: [17-04-2018 10:11:59]  [00:00:05.3645083]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Grant-Permission.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:05.4436754]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Grant-Privilege.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:05.4953420]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Grant-ServiceControlPermission.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:05.5464117]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Grant-ServicePermission.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:05.6034803]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Initialize-Lcm.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:05.6555942]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Install-Certificate.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:05.7106651]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Install-Directory.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:05.7582744]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Install-FileShare.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:05.8153773]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Install-Group.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:05.8744490]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Install-Junction.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:05.9340423]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Install-Msi.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:05.9906158]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Install-Msmq.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:06.0441845]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Install-MsmqMessageQueue.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:06.0927472]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Install-PerformanceCounter.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:06.1424533]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Install-RegistryKey.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:06.1966063]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Install-ScheduledTask.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:06.2471777]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Install-Service.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:06.3082408]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Install-User.ps1.
DEBUG: [17-04-2018 10:12:00]  [00:00:06.3663331]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Install-WindowsFeature.ps1.
DEBUG: [17-04-2018 10:12:01]  [00:00:06.4866065]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Invoke-AppCmd.ps1.
DEBUG: [17-04-2018 10:12:01]  [00:00:06.5456660]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Invoke-ConsoleCommand.ps1.
DEBUG: [17-04-2018 10:12:01]  [00:00:06.6027479]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Invoke-PowerShell.ps1.
DEBUG: [17-04-2018 10:12:01]  [00:00:06.6633392]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\New-Credential.ps1.
DEBUG: [17-04-2018 10:12:01]  [00:00:06.7108948]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\New-Junction.ps1.
DEBUG: [17-04-2018 10:12:01]  [00:00:06.7591623]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\New-RsaKeyPair.ps1.
DEBUG: [17-04-2018 10:12:01]  [00:00:06.8089911]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\New-TempDirectory.ps1.
DEBUG: [17-04-2018 10:12:01]  [00:00:06.8571962]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Protect-String.ps1.
DEBUG: [17-04-2018 10:12:01]  [00:00:06.9202865]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Read-File.ps1.
DEBUG: [17-04-2018 10:12:01]  [00:00:06.9843749]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Remove-DotNetAppSetting.ps1.
DEBUG: [17-04-2018 10:12:01]  [00:00:07.0484688]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Remove-EnvironmentVariable.ps1.
DEBUG: [17-04-2018 10:12:01]  [00:00:07.1090696]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Remove-GroupMember.ps1.
DEBUG: [17-04-2018 10:12:01]  [00:00:07.1686565]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Remove-HostsEntry.ps1.
DEBUG: [17-04-2018 10:12:01]  [00:00:07.2327496]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Remove-IniEntry.ps1.
DEBUG: [17-04-2018 10:12:01]  [00:00:07.3093518]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Remove-Junction.ps1.
DEBUG: [17-04-2018 10:12:02]  [00:00:07.3719395]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Remove-RegistryKeyValue.ps1.
DEBUG: [17-04-2018 10:12:02]  [00:00:07.4385289]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Remove-SslCertificateBinding.ps1.
DEBUG: [17-04-2018 10:12:02]  [00:00:07.5061187]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Reset-HostsFile.ps1.
DEBUG: [17-04-2018 10:12:02]  [00:00:07.5697029]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Reset-MsmqQueueManagerID.ps1.
DEBUG: [17-04-2018 10:12:02]  [00:00:07.6337901]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Resolve-FullPath.ps1.
DEBUG: [17-04-2018 10:12:02]  [00:00:07.6963846]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Resolve-Identity.ps1.
DEBUG: [17-04-2018 10:12:02]  [00:00:07.7524492]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Resolve-IdentityName.ps1.
DEBUG: [17-04-2018 10:12:02]  [00:00:07.8150437]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Resolve-NetPath.ps1.
DEBUG: [17-04-2018 10:12:02]  [00:00:07.8741407]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Resolve-PathCase.ps1.
DEBUG: [17-04-2018 10:12:02]  [00:00:07.9392386]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Resolve-RelativePath.ps1.
DEBUG: [17-04-2018 10:12:02]  [00:00:08.0028311]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Resolve-WindowsFeatureName.ps1.
DEBUG: [17-04-2018 10:12:02]  [00:00:08.0694264]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Restart-RemoteService.ps1.
DEBUG: [17-04-2018 10:12:02]  [00:00:08.1460262]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Revoke-ComPermission.ps1.
DEBUG: [17-04-2018 10:12:02]  [00:00:08.2030979]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Revoke-HttpUrlPermission.ps1.
DEBUG: [17-04-2018 10:12:02]  [00:00:08.2631653]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Revoke-Permission.ps1.
DEBUG: [17-04-2018 10:12:02]  [00:00:08.3219895]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Revoke-Privilege.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:08.3880696]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Revoke-ServicePermission.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:08.4501603]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Set-CryptoKeySecurity.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:08.5112341]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Set-DotNetAppSetting.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:08.5582891]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Set-DotNetConnectionString.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:08.6093753]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Set-EnvironmentVariable.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:08.6549613]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Set-HostsEntry.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:08.7070306]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Set-IniEntry.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:08.7606491]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Set-RegistryKeyValue.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:08.8082055]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Set-ServiceAcl.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:08.8628157]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Set-SslCertificateBinding.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:08.9104183]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Set-TrustedHost.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:08.9605637]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Split-Ini.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:09.0201420]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Start-DscPullConfiguration.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:09.0797376]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Start-PowerShellProcess.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:09.1368002]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-AdminPrivilege.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:09.1948716]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-DotNet.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:09.2514510]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-DscTargetResource.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:09.3135496]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-FileShare.ps1.
DEBUG: [17-04-2018 10:12:03]  [00:00:09.3676110]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-FirewallStatefulFtp.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:09.4256922]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-Group.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:09.4762542]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-GroupMember.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:09.5214979]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-Identity.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:09.5725762]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-IPAddress.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:09.6265923]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-MsmqMessageQueue.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:09.6732683]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-NtfsCompression.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:09.7263139]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-OSIs32Bit.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:09.7739181]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-OSIs64Bit.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:09.8264868]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-PathIsJunction.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:09.8738367]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-PerformanceCounter.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:09.9269285]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-PerformanceCounterCategory.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:09.9760432]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-Permission.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:10.0232987]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-PowerShellIs32Bit.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:10.0768694]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-PowerShellIs64Bit.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:10.1264420]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-Privilege.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:10.1743932]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-RegistryKeyValue.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:10.2274633]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-ScheduledTask.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:10.2740632]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-Service.ps1.
DEBUG: [17-04-2018 10:12:04]  [00:00:10.3287132]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-SslCertificateBinding.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:10.3757947]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-TypeDataMember.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:10.4251628]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-UncPath.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:10.4819522]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-User.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:10.5365490]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-WindowsFeature.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:10.5876487]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Test-ZipFile.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:10.6375999]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Uninstall-Certificate.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:10.6887189]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Uninstall-Directory.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:10.7393290]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Uninstall-FileShare.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:10.7899025]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Uninstall-Group.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:10.8419812]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Uninstall-Junction.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:10.8970754]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Uninstall-MsmqMessageQueue.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:10.9436350]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Uninstall-PerformanceCounterCategory.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:10.9902143]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Uninstall-ScheduledTask.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:11.0443116]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Uninstall-Service.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:11.0904914]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Uninstall-User.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:11.1480866]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Uninstall-WindowsFeature.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:11.2628392]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Unprotect-String.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:11.3139460]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Use-CallerPreference.ps1.
DEBUG: [17-04-2018 10:12:05]  [00:00:11.3615261]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Write-DscError.ps1.
DEBUG: [17-04-2018 10:12:06]  [00:00:11.4086371]  Importing function C:\Program Files\WindowsPowerShell\Modules\carbon\2.5.0\Functions\Write-File.ps1.
DEBUG: [17-04-2018 10:12:06]  [00:00:11.4602315]  Testing the module manifest.
DEBUG: [17-04-2018 10:12:06]  [00:00:11.4852851]  Exporting module members.
DEBUG: [17-04-2018 10:12:06]  [00:00:11.5032837]  DONE
@McAndersDK
Copy link
Contributor Author

@McAndersDK McAndersDK commented Jan 7, 2019

Hey Aaron,
This is still a problem for me.
DEBUG: [07-01-2019 11:51:30] [00:00:00] BEGIN
DEBUG: [07-01-2019 11:51:30] [00:00:00.0029970] Dot-sourcing Test-TypeDataMember.
DEBUG: [07-01-2019 11:51:30] [00:00:00.0610159] Dot-sourcing Use-CallerPreference.
DEBUG: [07-01-2019 11:51:30] [00:00:00.1229967] Adding System.Security assembly.
DEBUG: [07-01-2019 11:51:30] [00:00:00.1259878] Adding Ionic.Zip assembly.
DEBUG: [07-01-2019 11:51:30] [00:00:00.1409923] Adding System.Web assembly.
DEBUG: [07-01-2019 11:51:30] [00:00:00.1459873] Filtering out IIS functions.
DEBUG: [07-01-2019 11:51:30] [00:00:00.1619824] Adding System.ServiceProcess assembly.
DEBUG: [07-01-2019 11:51:30] [00:00:00.1649880] Adding System.Messaging assembly.
DEBUG: [07-01-2019 11:51:30] [00:00:00.1679841] Adding System.ServiceProcess assembly.
DEBUG: [07-01-2019 11:51:30] [00:00:00.1720195] Adding System.DirectoryServices.AccountManagement assembly.
DEBUG: [07-01-2019 11:51:30] [00:00:00.1799834] Checking if servermanagercmd.exe exists.
DEBUG: [07-01-2019 11:51:30] [00:00:00.2849731] Checking if Win32_OptionalFeature WMI class is available.
DEBUG: [07-01-2019 11:51:30] [00:00:00.2929700] Checking if ocsetup.exe exists.
DEBUG: [07-01-2019 11:51:30] [00:00:00.4229629] Dot-sourcing functions.
DEBUG: [07-01-2019 11:51:39] [00:00:09.6391803] Testing the module manifest.
DEBUG: [07-01-2019 11:51:39] [00:00:09.6621585] Creating aliases.
DEBUG: [07-01-2019 11:51:39] [00:00:09.7011599] Exporting module members.
DEBUG: [07-01-2019 11:51:39] [00:00:09.7151503] DONE

@McAndersDK
Copy link
Contributor Author

@McAndersDK McAndersDK commented Jun 14, 2019

@splatteredbits could you please open this again? :)

@splatteredbits
Copy link
Member

@splatteredbits splatteredbits commented Jun 14, 2019

Why? How long is it taking you to import?

@McAndersDK
Copy link
Contributor Author

@McAndersDK McAndersDK commented Aug 14, 2019

well the latest test show 12 seconds

My PC is running with "Windows Defender Advanced Threat Protection Service".
it's possible that it's the scan engine that introduce this slow down, but again, this can be solved by merge all the function files into the psm1 file.

DEBUG: [14-08-2019 11:04:50] [00:00:00.0009986] BEGIN
DEBUG: [14-08-2019 11:04:50] [00:00:00.0019973] Loading Carbon assemblies from "C:\Users-\Documents\WindowsPowerShell\Modules\carbon\2.8.1\bin\fullclr".
DEBUG: [14-08-2019 11:04:50] [00:00:00.0509312] Dot-sourcing Test-TypeDataMember.
DEBUG: [14-08-2019 11:04:50] [00:00:00.1079063] Dot-sourcing Use-CallerPreference.
DEBUG: [14-08-2019 11:04:50] [00:00:00.1673957] Adding System.Security assembly.
DEBUG: [14-08-2019 11:04:50] [00:00:00.1693935] Adding Ionic.Zip assembly.
DEBUG: [14-08-2019 11:04:50] [00:00:00.2083403] Adding System.Web assembly.
DEBUG: [14-08-2019 11:04:50] [00:00:00.2123618] Adding Microsoft.Web.Administration assembly.
DEBUG: [14-08-2019 11:04:50] [00:00:00.2153299] Adding Carbon.Iis assembly.
DEBUG: [14-08-2019 11:04:50] [00:00:00.2408341] Adding System.ServiceProcess assembly.
DEBUG: [14-08-2019 11:04:50] [00:00:00.2438026] Adding System.Messaging assembly.
DEBUG: [14-08-2019 11:04:50] [00:00:00.2458018] Adding System.ServiceProcess assembly.
DEBUG: [14-08-2019 11:04:50] [00:00:00.2487961] Adding System.DirectoryServices.AccountManagement assembly.
DEBUG: [14-08-2019 11:04:50] [00:00:00.2507952] Checking if servermanagercmd.exe exists.
DEBUG: [14-08-2019 11:04:50] [00:00:00.3185523] Checking if Win32_OptionalFeature WMI class is available.
DEBUG: [14-08-2019 11:04:50] [00:00:00.3305312] Checking if ocsetup.exe exists.
DEBUG: [14-08-2019 11:04:51] [00:00:00.3989487] Dot-sourcing functions.
DEBUG: [14-08-2019 11:04:51] [00:00:00.4698515] Add-GroupMember.ps1
DEBUG: [14-08-2019 11:04:51] [00:00:00.5267734] Add-IisDefaultDocument.ps1
DEBUG: [14-08-2019 11:04:51] [00:00:00.5787017] Add-IisServerManagerMember.ps1
DEBUG: [14-08-2019 11:04:51] [00:00:00.6326312] Add-TrustedHost.ps1
DEBUG: [14-08-2019 11:04:51] [00:00:00.6915468] Assert-AdminPrivilege.ps1
DEBUG: [14-08-2019 11:04:51] [00:00:00.7444744] Assert-FirewallConfigurable.ps1
DEBUG: [14-08-2019 11:04:51] [00:00:00.7954040] Assert-Service.ps1
DEBUG: [14-08-2019 11:04:51] [00:00:00.8491136] Assert-WindowsFeatureFunctionsSupported.ps1
DEBUG: [14-08-2019 11:04:51] [00:00:00.9020409] Clear-DscLocalResourceCache.ps1
DEBUG: [14-08-2019 11:04:51] [00:00:00.9629591] Clear-MofAuthoringMetadata.ps1
DEBUG: [14-08-2019 11:04:51] [00:00:01.0198791] Clear-TrustedHost.ps1
DEBUG: [14-08-2019 11:04:51] [00:00:01.0738049] Complete-Job.ps1
DEBUG: [14-08-2019 11:04:51] [00:00:01.1267323] Compress-Item.ps1
DEBUG: [14-08-2019 11:04:51] [00:00:01.1796595] Convert-SecureStringToString.ps1
DEBUG: [14-08-2019 11:04:51] [00:00:01.2355832] Convert-XmlFile.ps1
DEBUG: [14-08-2019 11:04:51] [00:00:01.2895087] ConvertFrom-Base64.ps1
DEBUG: [14-08-2019 11:04:51] [00:00:01.3424363] ConvertTo-Base64.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:01.3953634] ConvertTo-ContainerInheritanceFlags.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:01.4473903] ConvertTo-InheritanceFlag.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:01.5023151] ConvertTo-Key.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:01.5592378] ConvertTo-PropagationFlag.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:01.6101667] ConvertTo-ProviderAccessControlRights.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:01.6620954] ConvertTo-SecurityIdentifier.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:01.7160212] Copy-DscResource.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:01.7709459] Disable-AclInheritance.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:01.8219169] Disable-FirewallStatefulFtp.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:01.8768343] Disable-IEEnhancedSecurityConfiguration.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:01.9297280] Disable-IisSecurityAuthentication.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:01.9826551] Disable-NtfsCompression.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:02.0375803] Enable-AclInheritance.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:02.0915055] Enable-FirewallStatefulFtp.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:02.1414858] Enable-IEActivationPermission.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:02.1933657] Enable-IisDirectoryBrowsing.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:02.2442971] Enable-IisSecurityAuthentication.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:02.2967706] Enable-IisSsl.ps1
DEBUG: [14-08-2019 11:04:52] [00:00:02.3506966] Enable-NtfsCompression.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:02.4056213] Expand-Item.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:02.4635472] Find-ADUser.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:02.5174723] Format-ADSearchFilterValue.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:02.5723969] Get-ADDomainController.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:02.6273503] Get-Certificate.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:02.6792853] Get-CertificateStore.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:02.7302154] Get-ComPermission.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:02.7821441] Get-ComSecurityDescriptor.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:02.8350712] Get-DscError.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:02.8919985] Get-DscWinEvent.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:02.9439320] Get-FileShare.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:02.9978490] Get-FileSharePermission.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:03.0497765] Get-FirewallRule.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:03.1037024] Get-Group.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:03.1596598] Get-HttpUrlAcl.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:03.2105555] Get-IdentityPrincipalContext.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:03.2604869] Get-IisApplication.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:03.3144129] Get-IisAppPool.ps1
DEBUG: [14-08-2019 11:04:53] [00:00:03.3653430] Get-IisConfigurationSection.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:03.4192689] Get-IisHttpHeader.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:03.4731947] Get-IisHttpRedirect.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:03.5251235] Get-IisMimeMap.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:03.5780511] Get-IisSecurityAuthentication.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:03.6299794] Get-IisVersion.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:03.6809098] Get-IisWebsite.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:03.7308410] Get-IPAddress.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:03.7817709] Get-Msi.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:03.8362389] Get-MsmqMessageQueue.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:03.8881677] Get-MsmqMessageQueuePath.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:03.9441245] Get-PathProvider.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:03.9974758] Get-PathToHostsFile.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:04.0484066] Get-PerformanceCounter.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:04.1003346] Get-Permission.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:04.1522639] Get-PowerShellModuleInstallPath.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:04.2077919] Get-PowershellPath.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:04.2582303] Get-Privilege.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:04.3131550] Get-ProgramInstallInfo.ps1
DEBUG: [14-08-2019 11:04:54] [00:00:04.3640849] Get-RegistryKeyValue.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:04.4349876] Get-ScheduledTask.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:04.4893615] Get-ServiceAcl.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:04.5443112] Get-ServiceConfiguration.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:04.5952159] Get-ServicePermission.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:04.6461467] Get-ServiceSecurityDescriptor.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:04.6960773] Get-SslCertificateBinding.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:04.7470076] Get-TrustedHost.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:04.7979381] Get-User.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:04.8738328] Get-WindowsFeature.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:04.9291763] Get-WmiLocalUserAccount.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:04.9831386] Grant-ComPermission.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:05.0350673] Grant-HttpUrlPermission.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:05.0889934] Grant-MsmqMessageQueuePermission.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:05.1439177] Grant-Permission.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:05.1938489] Grant-Privilege.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:05.2468354] Grant-ServiceControlPermission.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:05.2997998] Grant-ServicePermission.ps1
DEBUG: [14-08-2019 11:04:55] [00:00:05.3517283] Initialize-Lcm.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:05.4066536] Install-Certificate.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:05.4606104] Install-Directory.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:05.5152307] Install-FileShare.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:05.5661605] Install-Group.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:05.6180893] Install-IisApplication.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:05.6696437] Install-IisAppPool.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:05.7265655] Install-IisVirtualDirectory.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:05.7824887] Install-IisWebsite.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:05.8334187] Install-Junction.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:05.8854559] Install-Msi.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:05.9363856] Install-Msmq.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:05.9923090] Install-MsmqMessageQueue.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:06.0457503] Install-PerformanceCounter.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:06.0986778] Install-RegistryKey.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:06.1506062] Install-ScheduledTask.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:06.2025350] Install-Service.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:06.2559983] Install-User.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:06.3308955] Install-WindowsFeature.ps1
DEBUG: [14-08-2019 11:04:56] [00:00:06.3834134] Invoke-AppCmd.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:06.4333450] Invoke-ConsoleCommand.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:06.4922637] Invoke-PowerShell.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:06.5472363] Join-IisVirtualPath.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:06.5976888] Lock-IisConfigurationSection.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:06.6496170] New-Credential.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:06.7012884] New-Junction.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:06.7542159] New-RsaKeyPair.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:06.8071433] New-TempDirectory.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:06.8620675] Protect-String.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:06.9163647] Read-File.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:06.9682943] Remove-DotNetAppSetting.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:07.0212207] Remove-EnvironmentVariable.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:07.0751466] Remove-GroupMember.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:07.1330673] Remove-HostsEntry.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:07.1859946] Remove-IisMimeMap.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:07.2429173] Remove-IniEntry.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:07.2938463] Remove-Junction.ps1
DEBUG: [14-08-2019 11:04:57] [00:00:07.3477721] Remove-RegistryKeyValue.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:07.3977052] Remove-SslCertificateBinding.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:07.4496322] Reset-HostsFile.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:07.5025597] Reset-MsmqQueueManagerID.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:07.5534897] Resolve-FullPath.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:07.6054183] Resolve-Identity.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:07.6603431] Resolve-IdentityName.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:07.7142688] Resolve-NetPath.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:07.7651988] Resolve-PathCase.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:07.8181259] Resolve-RelativePath.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:07.8701106] Resolve-WindowsFeatureName.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:07.9207729] Restart-RemoteService.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:07.9746988] Revoke-ComPermission.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:08.0296236] Revoke-HttpUrlPermission.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:08.0825506] Revoke-Permission.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:08.1330695] Revoke-Privilege.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:08.1840119] Revoke-ServicePermission.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:08.2342041] Set-CryptoKeySecurity.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:08.2861328] Set-DotNetAppSetting.ps1
DEBUG: [14-08-2019 11:04:58] [00:00:08.3490689] Set-DotNetConnectionString.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:08.4015073] Set-EnvironmentVariable.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:08.4524357] Set-HostsEntry.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:08.5026648] Set-IisHttpHeader.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:08.5555923] Set-IisHttpRedirect.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:08.6081331] Set-IisMimeMap.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:08.6600299] Set-IisWebsiteID.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:08.7139555] Set-IisWebsiteSslCertificate.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:08.7678814] Set-IisWindowsAuthentication.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:08.8183499] Set-IniEntry.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:08.8693169] Set-RegistryKeyValue.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:08.9202099] Set-ServiceAcl.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:08.9721467] Set-SslCertificateBinding.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:09.0260648] Set-TrustedHost.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:09.0809892] Split-Ini.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:09.1379109] Start-DscPullConfiguration.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:09.1898397] Start-PowerShellProcess.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:09.2447644] Test-AdminPrivilege.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:09.2962089] Test-DotNet.ps1
DEBUG: [14-08-2019 11:04:59] [00:00:09.3501360] Test-DscTargetResource.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:09.4000661] Test-FileShare.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:09.4519965] Test-FirewallStatefulFtp.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:09.5059206] Test-Group.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:09.5608455] Test-GroupMember.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:09.6105062] Test-Identity.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:09.6644324] Test-IisAppPool.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:09.7183730] Test-IisConfigurationSection.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:09.7692901] Test-IisSecurityAuthentication.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:09.8192197] Test-IisWebsite.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:09.8691510] Test-IPAddress.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:09.9190850] Test-MsmqMessageQueue.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:09.9700149] Test-NtfsCompression.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:10.0209425] Test-OSIs32Bit.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:10.0729088] Test-OSIs64Bit.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:10.1238383] Test-PathIsJunction.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:10.1767655] Test-PerformanceCounter.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:10.2316900] Test-PerformanceCounterCategory.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:10.2885734] Test-Permission.ps1
DEBUG: [14-08-2019 11:05:00] [00:00:10.3385050] Test-PowerShellIs32Bit.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:10.3904338] Test-PowerShellIs64Bit.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:10.4423623] Test-Privilege.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:10.4992843] Test-RegistryKeyValue.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:10.5532279] Test-ScheduledTask.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:10.6041404] Test-Service.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:10.6545768] Test-SslCertificateBinding.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:10.7025115] Test-TypeDataMember.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:10.7549443] Test-UncPath.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:10.8088807] Test-User.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:10.8608095] Test-WindowsFeature.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:10.9157333] Test-ZipFile.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:10.9716574] Uninstall-Certificate.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:11.0238663] Uninstall-Directory.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:11.0818185] Uninstall-FileShare.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:11.1407052] Uninstall-Group.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:11.1926340] Uninstall-IisAppPool.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:11.2505545] Uninstall-IisWebsite.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:11.3114716] Uninstall-Junction.ps1
DEBUG: [14-08-2019 11:05:01] [00:00:11.3748928] Uninstall-MsmqMessageQueue.ps1
DEBUG: [14-08-2019 11:05:02] [00:00:11.4258223] Uninstall-PerformanceCounterCategory.ps1
DEBUG: [14-08-2019 11:05:02] [00:00:11.4827445] Uninstall-ScheduledTask.ps1
DEBUG: [14-08-2019 11:05:02] [00:00:11.5366702] Uninstall-Service.ps1
DEBUG: [14-08-2019 11:05:02] [00:00:11.5885993] Uninstall-User.ps1
DEBUG: [14-08-2019 11:05:02] [00:00:11.6634962] Uninstall-WindowsFeature.ps1
DEBUG: [14-08-2019 11:05:02] [00:00:11.7174223] Unlock-IisConfigurationSection.ps1
DEBUG: [14-08-2019 11:05:02] [00:00:11.7733459] Unprotect-String.ps1
DEBUG: [14-08-2019 11:05:02] [00:00:11.8212792] Use-CallerPreference.ps1
DEBUG: [14-08-2019 11:05:02] [00:00:11.8722097] Write-DscError.ps1
DEBUG: [14-08-2019 11:05:02] [00:00:11.9271340] Write-File.ps1
DEBUG: [14-08-2019 11:05:02] [00:00:11.9800619] Write-IisVerbose.ps1
DEBUG: [14-08-2019 11:05:02] [00:00:11.9820589] Testing the module manifest.
DEBUG: [14-08-2019 11:05:02] [00:00:11.9960393] Creating aliases.
DEBUG: [14-08-2019 11:05:02] [00:00:12.0150136] Exporting module members.
DEBUG: [14-08-2019 11:05:02] [00:00:12.0249994] DONE

okey so I found this: https://www.codykonior.com/2019/04/18/expensive-dot-sourcing-in-powershell-modules-revisited/

and tried that out:

<#
Write-Timing ('Dot-sourcing functions.')
Get-ChildItem -Path $functionRoot -Filter '*.ps1' | 
                    Where-Object { -not $doNotImport.Contains($_.Name) } |
                    ForEach-Object {
                        Write-Verbose ("Importing function {0}." -f $_.FullName)
                        . $_.FullName | Out-Null
                    }
#>
Write-Timing ('Test new Way Dot-sourcing functions.')
$content = Get-ChildItem -Path $functionRoot -Filter '*.ps1' | ForEach-Object {
    [System.IO.File]::ReadAllText($_.FullName, [Text.Encoding]::UTF8) + [Environment]::NewLine
}
. ([scriptblock]::Create($content))

that did a very drastic drop in load time:

DEBUG: [14-08-2019 11:26:06] [00:00:00] BEGIN
DEBUG: [14-08-2019 11:26:06] [00:00:00.0039896] Loading Carbon assemblies from "C:\Users-\Documents\WindowsPowerShell\Modules\carbon\2.8.1\bin\fullclr".
DEBUG: [14-08-2019 11:26:06] [00:00:00.0479930] Dot-sourcing Test-TypeDataMember.
DEBUG: [14-08-2019 11:26:06] [00:00:00.1032210] Dot-sourcing Use-CallerPreference.
DEBUG: [14-08-2019 11:26:06] [00:00:00.1610530] Adding System.Security assembly.
DEBUG: [14-08-2019 11:26:06] [00:00:00.1640445] Adding Ionic.Zip assembly.
DEBUG: [14-08-2019 11:26:06] [00:00:00.2057757] Adding System.Web assembly.
DEBUG: [14-08-2019 11:26:06] [00:00:00.2097655] Adding Microsoft.Web.Administration assembly.
DEBUG: [14-08-2019 11:26:06] [00:00:00.2137553] Adding Carbon.Iis assembly.
DEBUG: [14-08-2019 11:26:06] [00:00:00.2446723] Adding System.ServiceProcess assembly.
DEBUG: [14-08-2019 11:26:06] [00:00:00.2476651] Adding System.Messaging assembly.
DEBUG: [14-08-2019 11:26:06] [00:00:00.2516554] Adding System.ServiceProcess assembly.
DEBUG: [14-08-2019 11:26:06] [00:00:00.2536522] Adding System.DirectoryServices.AccountManagement assembly.
DEBUG: [14-08-2019 11:26:06] [00:00:00.2626248] Checking if servermanagercmd.exe exists.
DEBUG: [14-08-2019 11:26:06] [00:00:00.3394219] Checking if Win32_OptionalFeature WMI class is available.
DEBUG: [14-08-2019 11:26:06] [00:00:00.3523885] Checking if ocsetup.exe exists.
DEBUG: [14-08-2019 11:26:06] [00:00:00.4371651] Test new Way Dot-sourcing functions.
DEBUG: [14-08-2019 11:26:07] [00:00:01.5956413] Testing the module manifest.
DEBUG: [14-08-2019 11:26:07] [00:00:01.6086028] Creating aliases.
DEBUG: [14-08-2019 11:26:07] [00:00:01.6275859] Exporting module members.
DEBUG: [14-08-2019 11:26:07] [00:00:01.6455053] DONE

@splatteredbits
Copy link
Member

@splatteredbits splatteredbits commented Aug 16, 2019

Yowzers. That's amazing that it takes 12 seconds to read and parse 200 files.

Can you merge them all into one external file, like Functions.ps1, and dot-source that and tell me how long it takes?

I'm thinking I'll merge all the files into one Functions\Functions.ps1 file at build time. That way, I won't have to change Carbon.psm1's import strategy.

@McAndersDK
Copy link
Contributor Author

@McAndersDK McAndersDK commented Aug 16, 2019

you can get that here:

DEBUG: [16-08-2019 21:36:56] [00:00:00.0009974] BEGIN
DEBUG: [16-08-2019 21:36:56] [00:00:00.0030218] Loading Carbon assemblies from "C:\Users\aan\Documents\WindowsPowerShell\Modules\carbon\2.8.1\bin\fullclr".
DEBUG: [16-08-2019 21:36:56] [00:00:00.0110031] Dot-sourcing Test-TypeDataMember.
DEBUG: [16-08-2019 21:36:56] [00:00:00.0918201] Dot-sourcing Use-CallerPreference.
DEBUG: [16-08-2019 21:36:56] [00:00:00.2124727] Adding System.Security assembly.
DEBUG: [16-08-2019 21:36:56] [00:00:00.2144933] Adding Ionic.Zip assembly.
DEBUG: [16-08-2019 21:36:57] [00:00:00.2234424] Adding System.Web assembly.
DEBUG: [16-08-2019 21:36:57] [00:00:00.2280005] Adding Microsoft.Web.Administration assembly.
DEBUG: [16-08-2019 21:36:57] [00:00:00.2309930] Adding Carbon.Iis assembly.
DEBUG: [16-08-2019 21:36:57] [00:00:00.2449721] Adding System.ServiceProcess assembly.
DEBUG: [16-08-2019 21:36:57] [00:00:00.2479475] Adding System.Messaging assembly.
DEBUG: [16-08-2019 21:36:57] [00:00:00.2499422] Adding System.ServiceProcess assembly.
DEBUG: [16-08-2019 21:36:57] [00:00:00.2519366] Adding System.DirectoryServices.AccountManagement assembly.
DEBUG: [16-08-2019 21:36:57] [00:00:00.2539321] Checking if servermanagercmd.exe exists.
DEBUG: [16-08-2019 21:36:57] [00:00:00.3408330] Checking if Win32_OptionalFeature WMI class is available.
DEBUG: [16-08-2019 21:36:57] [00:00:00.3557595] Checking if ocsetup.exe exists.
DEBUG: [16-08-2019 21:36:57] [00:00:00.4999053] Test One File Dot-sourcing functions.
DEBUG: [16-08-2019 21:36:57] [00:00:01.0032923] Testing the module manifest.
DEBUG: [16-08-2019 21:36:57] [00:00:01.0512672] Creating aliases.
DEBUG: [16-08-2019 21:36:57] [00:00:01.0831501] Exporting module members.
DEBUG: [16-08-2019 21:36:57] [00:00:01.0951201] DONE

@splatteredbits
Copy link
Member

@splatteredbits splatteredbits commented Sep 6, 2019

OK. I think I've finally fixed it (or made it as fast as I can). Please download Carbon.zip, unblock it, unzip it, and let me know how long it takes you to import Carbon in a fresh console. On my machine, it takes about two seconds now.

These changes will be in Carbon 2.9.

@splatteredbits splatteredbits modified the milestones: 2.6.0, 2.9.0 Sep 6, 2019
@McAndersDK
Copy link
Contributor Author

@McAndersDK McAndersDK commented Sep 10, 2019

yes much better!

DEBUG: [10-09-2019 13:43:20]  [00:00:00.0079783]  BEGIN
DEBUG: [10-09-2019 13:43:20]  [00:00:00.0249334]  Loading Carbon assemblies from
"C:\Users\User\Downloads\Carbon\bin\fullclr".
DEBUG: [10-09-2019 13:43:20]  [00:00:00.0977356]  Adding System.Security assembly.
DEBUG: [10-09-2019 13:43:20]  [00:00:00.1057125]  Adding Ionic.Zip assembly.
DEBUG: [10-09-2019 13:43:20]  [00:00:00.1702222]  Adding System.Web assembly.
DEBUG: [10-09-2019 13:43:20]  [00:00:00.1831871]  Adding Microsoft.Web.Administration assembly.
DEBUG: [10-09-2019 13:43:20]  [00:00:00.2111118]  Adding Carbon.Iis assembly.
DEBUG: [10-09-2019 13:43:20]  [00:00:00.2370410]  Dot-sourcing functions.
DEBUG: [10-09-2019 13:43:22]  [00:00:01.5389062]  Dot-sourcing IIS functions.
DEBUG: [10-09-2019 13:43:22]  [00:00:01.6615745]  Updating Microsoft.Web.Administration.Site type data.
DEBUG: [10-09-2019 13:43:22]  [00:00:01.6705519]  Updating Microsoft.Web.Administration.Application type data.
DEBUG: [10-09-2019 13:43:22]  [00:00:01.6745386]  Adding System.ServiceProcess assembly.
DEBUG: [10-09-2019 13:43:22]  [00:00:01.6775313]  Adding System.Messaging assembly.
DEBUG: [10-09-2019 13:43:22]  [00:00:01.6825169]  Adding System.ServiceProcess assembly.
DEBUG: [10-09-2019 13:43:22]  [00:00:01.6855090]  Adding System.DirectoryServices.AccountManagement assembly.
DEBUG: [10-09-2019 13:43:22]  [00:00:01.7014634]  Updating System.IO.FileInfo type data (GetCarbonFileInfo).
DEBUG: [10-09-2019 13:43:22]  [00:00:01.7084448]  Updating System.IO.FileInfo type data (FileIndex).
DEBUG: [10-09-2019 13:43:22]  [00:00:01.7144287]  Updating System.IO.FileInfo type data (LinkCount).
DEBUG: [10-09-2019 13:43:22]  [00:00:01.7224102]  Updating System.IO.FileInfo type data (ColumeSerialNumber).
DEBUG: [10-09-2019 13:43:22]  [00:00:01.7244039]  Testing the module manifest.
DEBUG: [10-09-2019 13:43:22]  [00:00:01.7463434]  Creating aliases.
DEBUG: [10-09-2019 13:43:22]  [00:00:01.7752662]  Exporting module members.
DEBUG: [10-09-2019 13:43:22]  [00:00:01.7952096]  DONE
@splatteredbits
Copy link
Member

@splatteredbits splatteredbits commented Sep 16, 2019

Fixed in Carbon 2.9.0-rc587, now available on the PowerShell Gallery and GitHub. Please takea few minutes to download and test that your issue is fixed. We'll be publishing the final version of 2.9.0 Wednesday or Thursday.

@McAndersDK
Copy link
Contributor Author

@McAndersDK McAndersDK commented Sep 17, 2019

it's still quick:

C:\WINDOWS\system32> Measure-Command { import-module carbon -MinimumVersion 2.9.0}

Days              : 0
Hours             : 0
Minutes           : 0
Seconds           : 0
Milliseconds      : 931
Ticks             : 9319003
TotalDays         : 1,07858831018519E-05
TotalHours        : 0,000258861194444444
TotalMinutes      : 0,0155316716666667
TotalSeconds      : 0,9319003
TotalMilliseconds : 931,9003
@McAndersDK
Copy link
Contributor Author

@McAndersDK McAndersDK commented Sep 17, 2019

Maybe include a test for module loading requires load time under 1 sec? :D

@splatteredbits
Copy link
Member

@splatteredbits splatteredbits commented Sep 17, 2019

That's a tricky test. When developing, Carbon isn't optimized, meaning there are over 200 files that get dot-sourced every import, which take anywhere from 7 to 15 seconds.

Carbon builds take about 20 minutes. I'd hate to have a build fail because one time Carbon imported really slow just that one time.

🤔

@splatteredbits
Copy link
Member

@splatteredbits splatteredbits commented Sep 17, 2019

I am very happy to see it imported in less than a second for you.

@splatteredbits
Copy link
Member

@splatteredbits splatteredbits commented Sep 17, 2019

OK. So, I've written a test that imports Carbon seven times, throws out the fastest and the slowest speeds, than averages the remaining five and asserts that the average import takes less than a second. I think that approach should help smooth out any weird imports that take longer/faster than usual.

@splatteredbits
Copy link
Member

@splatteredbits splatteredbits commented Sep 19, 2019

2.9.0 is out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.