First published on TECHNET on Jan 10, 2013
This error message - File skipped because it was already present from Microsoft.PowerShell - can appear when a workflow is run that is loading the Service Manager modules that are provided out of the box. Something similar to this used to happen when loading the SMLets module in a workflow. We fixed the SMLets issue in SMLets Beta 3, but now we are getting reports that this is also happening with the Service Manager module provided out of the box. Here is an example:
http://social.technet.microsoft.com/Forums/en-US/systemcenterservicemanager/thread/bb0909c9-1589-4b60-957c-12b865e506eb
The symptom of this problem is that the first time the workflow runs it will do what it is supposed to do, but subsequent runs of the PowerShell in the workflow will fail because of this error. The problem is that the workflow engine has already loaded the module into the PowerShell runspace. When the script tells it to import the module again it fails.
To resolve this issue, Manoj Parvathaneni, one of our Senior Support Escalation Engineers, provides these instructions:
1. Comment out the following lines in the file Microsoft.EnterpriseManagement.Core.Cmdlets.psd1 . The file can be found on the drive where SM is installed and under the following path Program FilesMicrosoft System Center 2012Service ManagerPowershellMicrosoft.EnterpriseManagement.Core.Cmdlets
# The type files (.ps1xml) loaded by this module.
TypesToProcess = 'Microsoft.EnterpriseManagement.Core.Cmdlets.Types.ps1xml'
# The format files (.ps1xml) loaded by this module.
FormatsToProcess = 'Microsoft.EnterpriseManagement.Core.Cmdlets.Format.ps1xml'
Basically add the # character at the beginning of the two code lines above. After the change it would look like the following:
# The type files (.ps1xml) loaded by this module.
# TypesToProcess = 'Microsoft.EnterpriseManagement.Core.Cmdlets.Types.ps1xml'
# The format files (.ps1xml) loaded by this module.
# FormatsToProcess = 'Microsoft.EnterpriseManagement.Core.Cmdlets.Format.ps1xml'
2. Comment the following lines in the file Microsoft.EnterpriseManagement.ServiceManager.Cmdlets.psd1 . The file can be found on the drive where SM is installed and under the following path Program FilesMicrosoft System Center 2012Service ManagerPowershellMicrosoft.EnterpriseManagement.ServiceManager.Cmdlets
# The type files (.ps1xml) loaded by this module.
TypesToProcess = 'Microsoft.EnterpriseManagement.ServiceManager.Cmdlets.Types.ps1xml'
# The format files (.ps1xml) loaded by this module.
FormatsToProcess = 'Microsoft.EnterpriseManagement.ServiceManager.Cmdlets.Format.ps1xml'
Basically add the # character at the beginning of the two code lines above. After the change it would look like the following:
# The type files (.ps1xml) loaded by this module.
# TypesToProcess = 'Microsoft.EnterpriseManagement.ServiceManager.Cmdlets.Types.ps1xml'
# The format files (.ps1xml) loaded by this module.
# FormatsToProcess = 'Microsoft.EnterpriseManagement.ServiceManager.Cmdlets.Format.ps1xml'
3. Add the following entries to the end of the module file System.Center.Service.Manager.psm1 . The file can be found on the drive where SM is installed and under the following path Program FilesMicrosoft System Center 2012Service ManagerPowershell.
$SMDIR = (Get-ItemProperty 'hklm:/software/microsoft/System Center/2010/Service Manager/Setup').InstallDirectory
$SMPowerShell= "$SMDIRPowershell"
Update-TypeData $SMPowerShellMicrosoft.EnterpriseManagement.Core.CmdletsMicrosoft.EnterpriseManagement.Core.Cmdlets.Types.ps1xml,$SMPowerShellMicrosoft.EnterpriseManagement.ServiceManager.CmdletsMicrosoft.EnterpriseManagement.ServiceManager.Cmdlets.Types.ps1xml -ErrorAction SilentlyContinue
Update-FormatData $SMPowerShellMicrosoft.EnterpriseManagement.Core.CmdletsMicrosoft.EnterpriseManagement.Core.Cmdlets.Format.ps1xml,$SMPowerShellMicrosoft.EnterpriseManagement.ServiceManager.CmdletsMicrosoft.EnterpriseManagement.ServiceManager.Cmdlets.Format.ps1xml -ErrorAction SilentlyContinue
This error message - File skipped because it was already present from Microsoft.PowerShell - can appear when a workflow is run that is loading the Service Manager modules that are provided out of the box. Something similar to this used to happen when loading the SMLets module in a workflow. We fixed the SMLets issue in SMLets Beta 3, but now we are getting reports that this is also happening with the Service Manager module provided out of the box. Here is an example:
http://social.technet.microsoft.com/Forums/en-US/systemcenterservicemanager/thread/bb0909c9-1589-4b60-957c-12b865e506eb
The symptom of this problem is that the first time the workflow runs it will do what it is supposed to do, but subsequent runs of the PowerShell in the workflow will fail because of this error. The problem is that the workflow engine has already loaded the module into the PowerShell runspace. When the script tells it to import the module again it fails.
To resolve this issue, Manoj Parvathaneni, one of our Senior Support Escalation Engineers, provides these instructions:
1. Comment out the following lines in the file Microsoft.EnterpriseManagement.Core.Cmdlets.psd1 . The file can be found on the drive where SM is installed and under the following path Program FilesMicrosoft System Center 2012Service ManagerPowershellMicrosoft.EnterpriseManagement.Core.Cmdlets
# The type files (.ps1xml) loaded by this module.
TypesToProcess = 'Microsoft.EnterpriseManagement.Core.Cmdlets.Types.ps1xml'
# The format files (.ps1xml) loaded by this module.
FormatsToProcess = 'Microsoft.EnterpriseManagement.Core.Cmdlets.Format.ps1xml'
Basically add the # character at the beginning of the two code lines above. After the change it would look like the following:
# The type files (.ps1xml) loaded by this module.
# TypesToProcess = 'Microsoft.EnterpriseManagement.Core.Cmdlets.Types.ps1xml'
# The format files (.ps1xml) loaded by this module.
# FormatsToProcess = 'Microsoft.EnterpriseManagement.Core.Cmdlets.Format.ps1xml'
2. Comment the following lines in the file Microsoft.EnterpriseManagement.ServiceManager.Cmdlets.psd1 . The file can be found on the drive where SM is installed and under the following path Program FilesMicrosoft System Center 2012Service ManagerPowershellMicrosoft.EnterpriseManagement.ServiceManager.Cmdlets
# The type files (.ps1xml) loaded by this module.
TypesToProcess = 'Microsoft.EnterpriseManagement.ServiceManager.Cmdlets.Types.ps1xml'
# The format files (.ps1xml) loaded by this module.
FormatsToProcess = 'Microsoft.EnterpriseManagement.ServiceManager.Cmdlets.Format.ps1xml'
Basically add the # character at the beginning of the two code lines above. After the change it would look like the following:
# The type files (.ps1xml) loaded by this module.
# TypesToProcess = 'Microsoft.EnterpriseManagement.ServiceManager.Cmdlets.Types.ps1xml'
# The format files (.ps1xml) loaded by this module.
# FormatsToProcess = 'Microsoft.EnterpriseManagement.ServiceManager.Cmdlets.Format.ps1xml'
3. Add the following entries to the end of the module file System.Center.Service.Manager.psm1 . The file can be found on the drive where SM is installed and under the following path Program FilesMicrosoft System Center 2012Service ManagerPowershell.
$SMDIR = (Get-ItemProperty 'hklm:/software/microsoft/System Center/2010/Service Manager/Setup').InstallDirectory
$SMPowerShell= "$SMDIRPowershell"
Update-TypeData $SMPowerShellMicrosoft.EnterpriseManagement.Core.CmdletsMicrosoft.EnterpriseManagement.Core.Cmdlets.Types.ps1xml,$SMPowerShellMicrosoft.EnterpriseManagement.ServiceManager.CmdletsMicrosoft.EnterpriseManagement.ServiceManager.Cmdlets.Types.ps1xml -ErrorAction SilentlyContinue
Update-FormatData $SMPowerShellMicrosoft.EnterpriseManagement.Core.CmdletsMicrosoft.EnterpriseManagement.Core.Cmdlets.Format.ps1xml,$SMPowerShellMicrosoft.EnterpriseManagement.ServiceManager.CmdletsMicrosoft.EnterpriseManagement.ServiceManager.Cmdlets.Format.ps1xml -ErrorAction SilentlyContinue
Thanks Manoj for providing this information!!
Updated Mar 11, 2019
Version 4.0System-Center-Team
Microsoft
Joined February 15, 2019
System Center Blog
Follow this blog board to get notified when there's new activity