Hi,
to speed up the execution of some scripts I need to permanently save the result of a pipeline (or a variable).
I tried to save yes .csv and on .xml but I realized that some "MemberType" (in particular the "Method") are not then reloaded on the next import.
Is there a way to fully export and import all "MemberType" to a file ??
many thanks in advance.
PS C:\tmp> $myva1 = Get-Process
PS C:\tmp> $myva1 | Export-Clixml testfileexport.xml
PS C:\tmp> $myva2 = Import-Clixml .\testfileexport.xml
PS C:\tmp> $myva1 | Get-Member -Force
TypeName: System.Diagnostics.Process
Name MemberType Definition
---- ---------- ----------
Handles AliasProperty Handles = Handlecount
Name AliasProperty Name = ProcessName
NPM AliasProperty NPM = NonpagedSystemMemorySize64
PM AliasProperty PM = PagedMemorySize64
SI AliasProperty SI = SessionId
VM AliasProperty VM = VirtualMemorySize64
WS AliasProperty WS = WorkingSet64
pstypenames CodeProperty System.Collections.ObjectModel.Collection`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken...
Disposed Event System.EventHandler Disposed(System.Object, System.EventArgs)
ErrorDataReceived Event System.Diagnostics.DataReceivedEventHandler ErrorDataReceived(System.Object, System.Diagnostics.DataReceivedEventArgs)
Exited Event System.EventHandler Exited(System.Object, System.EventArgs)
OutputDataReceived Event System.Diagnostics.DataReceivedEventHandler OutputDataReceived(System.Object, System.Diagnostics.DataReceivedEventArgs)
psadapted MemberSet psadapted {BasePriority, ExitCode, HasExited, ExitTime, Handle, SafeHandle, HandleCount, Id, MachineName, MainWindowHa...
psbase MemberSet psbase {BasePriority, ExitCode, HasExited, ExitTime, Handle, SafeHandle, HandleCount, Id, MachineName, MainWindowHandl...
psextended MemberSet psextended {PSConfiguration, PSResources, Name, SI, Handles, VM, WS, PM, NPM, Path, Company, CPU, FileVersion, Product...
psobject MemberSet psobject {BaseObject, Members, Properties, Methods, ImmediateBaseObject, TypeNames, get_BaseObject, get_Members, get_P...
PSStandardMembers MemberSet PSStandardMembers {DefaultDisplayPropertySet}
add_Disposed Method void add_Disposed(System.EventHandler value), void IComponent.add_Disposed(System.EventHandler value)
add_ErrorDataReceived Method void add_ErrorDataReceived(System.Diagnostics.DataReceivedEventHandler value)
add_Exited Method void add_Exited(System.EventHandler value)
add_OutputDataReceived Method void add_OutputDataReceived(System.Diagnostics.DataReceivedEventHandler value)
BeginErrorReadLine Method void BeginErrorReadLine()
BeginOutputReadLine Method void BeginOutputReadLine()
CancelErrorRead Method void CancelErrorRead()
CancelOutputRead Method void CancelOutputRead()
Close Method void Close()
CloseMainWindow Method bool CloseMainWindow()
CreateObjRef Method System.Runtime.Remoting.ObjRef CreateObjRef(type requestedType)
Dispose Method void Dispose(), void IDisposable.Dispose()
Equals Method bool Equals(System.Object obj)
GetHashCode Method int GetHashCode()
GetLifetimeService Method System.Object GetLifetimeService()
GetType Method type GetType()
get_BasePriority Method int get_BasePriority()
get_Container Method System.ComponentModel.IContainer get_Container()
get_EnableRaisingEvents Method bool get_EnableRaisingEvents()
get_ExitCode Method int get_ExitCode()
get_ExitTime Method datetime get_ExitTime()
get_Handle Method System.IntPtr get_Handle()
get_HandleCount Method int get_HandleCount()
get_HasExited Method bool get_HasExited()
get_Id Method int get_Id()
get_MachineName Method string get_MachineName()
get_MainModule Method System.Diagnostics.ProcessModule get_MainModule()
get_MainWindowHandle Method System.IntPtr get_MainWindowHandle()
get_MainWindowTitle Method string get_MainWindowTitle()
get_MaxWorkingSet Method System.IntPtr get_MaxWorkingSet()
get_MinWorkingSet Method System.IntPtr get_MinWorkingSet()
get_Modules Method System.Diagnostics.ProcessModuleCollection get_Modules()
get_NonpagedSystemMemorySize Method int get_NonpagedSystemMemorySize()
get_NonpagedSystemMemorySize64 Method long get_NonpagedSystemMemorySize64()
get_PagedMemorySize Method int get_PagedMemorySize()
get_PagedMemorySize64 Method long get_PagedMemorySize64()
get_PagedSystemMemorySize Method int get_PagedSystemMemorySize()
get_PagedSystemMemorySize64 Method long get_PagedSystemMemorySize64()
get_PeakPagedMemorySize Method int get_PeakPagedMemorySize()
get_PeakPagedMemorySize64 Method long get_PeakPagedMemorySize64()
get_PeakVirtualMemorySize Method int get_PeakVirtualMemorySize()
get_PeakVirtualMemorySize64 Method long get_PeakVirtualMemorySize64()
get_PeakWorkingSet Method int get_PeakWorkingSet()
get_PeakWorkingSet64 Method long get_PeakWorkingSet64()
get_PriorityBoostEnabled Method bool get_PriorityBoostEnabled()
get_PriorityClass Method System.Diagnostics.ProcessPriorityClass get_PriorityClass()
get_PrivateMemorySize Method int get_PrivateMemorySize()
get_PrivateMemorySize64 Method long get_PrivateMemorySize64()
get_PrivilegedProcessorTime Method timespan get_PrivilegedProcessorTime()
get_ProcessName Method string get_ProcessName()
get_ProcessorAffinity Method System.IntPtr get_ProcessorAffinity()
get_Responding Method bool get_Responding()
get_SafeHandle Method Microsoft.Win32.SafeHandles.SafeProcessHandle get_SafeHandle()
get_SessionId Method int get_SessionId()
get_Site Method System.ComponentModel.ISite get_Site(), System.ComponentModel.ISite IComponent.get_Site()
get_StandardError Method System.IO.StreamReader get_StandardError()
get_StandardInput Method System.IO.StreamWriter get_StandardInput()
get_StandardOutput Method System.IO.StreamReader get_StandardOutput()
get_StartInfo Method System.Diagnostics.ProcessStartInfo get_StartInfo()
get_StartTime Method datetime get_StartTime()
get_SynchronizingObject Method System.ComponentModel.ISynchronizeInvoke get_SynchronizingObject()
get_Threads Method System.Diagnostics.ProcessThreadCollection get_Threads()
get_TotalProcessorTime Method timespan get_TotalProcessorTime()
get_UserProcessorTime Method timespan get_UserProcessorTime()
get_VirtualMemorySize Method int get_VirtualMemorySize()
get_VirtualMemorySize64 Method long get_VirtualMemorySize64()
get_WorkingSet Method int get_WorkingSet()
get_WorkingSet64 Method long get_WorkingSet64()
InitializeLifetimeService Method System.Object InitializeLifetimeService()
Kill Method void Kill()
Refresh Method void Refresh()
remove_Disposed Method void remove_Disposed(System.EventHandler value), void IComponent.remove_Disposed(System.EventHandler value)
remove_ErrorDataReceived Method void remove_ErrorDataReceived(System.Diagnostics.DataReceivedEventHandler value)
remove_Exited Method void remove_Exited(System.EventHandler value)
remove_OutputDataReceived Method void remove_OutputDataReceived(System.Diagnostics.DataReceivedEventHandler value)
set_EnableRaisingEvents Method void set_EnableRaisingEvents(bool value)
set_MaxWorkingSet Method void set_MaxWorkingSet(System.IntPtr value)
set_MinWorkingSet Method void set_MinWorkingSet(System.IntPtr value)
set_PriorityBoostEnabled Method void set_PriorityBoostEnabled(bool value)
set_PriorityClass Method void set_PriorityClass(System.Diagnostics.ProcessPriorityClass value)
set_ProcessorAffinity Method void set_ProcessorAffinity(System.IntPtr value)
set_Site Method void set_Site(System.ComponentModel.ISite value), void IComponent.set_Site(System.ComponentModel.ISite value)
set_StartInfo Method void set_StartInfo(System.Diagnostics.ProcessStartInfo value)
set_SynchronizingObject Method void set_SynchronizingObject(System.ComponentModel.ISynchronizeInvoke value)
Start Method bool Start()
ToString Method string ToString()
WaitForExit Method bool WaitForExit(int milliseconds), void WaitForExit()
WaitForInputIdle Method bool WaitForInputIdle(int milliseconds), bool WaitForInputIdle()
__NounName NoteProperty string __NounName=Process
BasePriority Property int BasePriority {get;}
Container Property System.ComponentModel.IContainer Container {get;}
EnableRaisingEvents Property bool EnableRaisingEvents {get;set;}
ExitCode Property int ExitCode {get;}
ExitTime Property datetime ExitTime {get;}
Handle Property System.IntPtr Handle {get;}
HandleCount Property int HandleCount {get;}
HasExited Property bool HasExited {get;}
Id Property int Id {get;}
MachineName Property string MachineName {get;}
MainModule Property System.Diagnostics.ProcessModule MainModule {get;}
MainWindowHandle Property System.IntPtr MainWindowHandle {get;}
MainWindowTitle Property string MainWindowTitle {get;}
MaxWorkingSet Property System.IntPtr MaxWorkingSet {get;set;}
MinWorkingSet Property System.IntPtr MinWorkingSet {get;set;}
Modules Property System.Diagnostics.ProcessModuleCollection Modules {get;}
NonpagedSystemMemorySize Property int NonpagedSystemMemorySize {get;}
NonpagedSystemMemorySize64 Property long NonpagedSystemMemorySize64 {get;}
PagedMemorySize Property int PagedMemorySize {get;}
PagedMemorySize64 Property long PagedMemorySize64 {get;}
PagedSystemMemorySize Property int PagedSystemMemorySize {get;}
PagedSystemMemorySize64 Property long PagedSystemMemorySize64 {get;}
PeakPagedMemorySize Property int PeakPagedMemorySize {get;}
PeakPagedMemorySize64 Property long PeakPagedMemorySize64 {get;}
PeakVirtualMemorySize Property int PeakVirtualMemorySize {get;}
PeakVirtualMemorySize64 Property long PeakVirtualMemorySize64 {get;}
PeakWorkingSet Property int PeakWorkingSet {get;}
PeakWorkingSet64 Property long PeakWorkingSet64 {get;}
PriorityBoostEnabled Property bool PriorityBoostEnabled {get;set;}
PriorityClass Property System.Diagnostics.ProcessPriorityClass PriorityClass {get;set;}
PrivateMemorySize Property int PrivateMemorySize {get;}
PrivateMemorySize64 Property long PrivateMemorySize64 {get;}
PrivilegedProcessorTime Property timespan PrivilegedProcessorTime {get;}
ProcessName Property string ProcessName {get;}
ProcessorAffinity Property System.IntPtr ProcessorAffinity {get;set;}
Responding Property bool Responding {get;}
SafeHandle Property Microsoft.Win32.SafeHandles.SafeProcessHandle SafeHandle {get;}
SessionId Property int SessionId {get;}
Site Property System.ComponentModel.ISite Site {get;set;}
StandardError Property System.IO.StreamReader StandardError {get;}
StandardInput Property System.IO.StreamWriter StandardInput {get;}
StandardOutput Property System.IO.StreamReader StandardOutput {get;}
StartInfo Property System.Diagnostics.ProcessStartInfo StartInfo {get;set;}
StartTime Property datetime StartTime {get;}
SynchronizingObject Property System.ComponentModel.ISynchronizeInvoke SynchronizingObject {get;set;}
Threads Property System.Diagnostics.ProcessThreadCollection Threads {get;}
TotalProcessorTime Property timespan TotalProcessorTime {get;}
UserProcessorTime Property timespan UserProcessorTime {get;}
VirtualMemorySize Property int VirtualMemorySize {get;}
VirtualMemorySize64 Property long VirtualMemorySize64 {get;}
WorkingSet Property int WorkingSet {get;}
WorkingSet64 Property long WorkingSet64 {get;}
PSConfiguration PropertySet PSConfiguration {Name, Id, PriorityClass, FileVersion}
PSResources PropertySet PSResources {Name, Id, Handlecount, WorkingSet, NonPagedMemorySize, PagedMemorySize, PrivateMemorySize, VirtualMemoryS...
Company ScriptProperty System.Object Company {get=$this.Mainmodule.FileVersionInfo.CompanyName;}
CPU ScriptProperty System.Object CPU {get=$this.TotalProcessorTime.TotalSeconds;}
Description ScriptProperty System.Object Description {get=$this.Mainmodule.FileVersionInfo.FileDescription;}
FileVersion ScriptProperty System.Object FileVersion {get=$this.Mainmodule.FileVersionInfo.FileVersion;}
Path ScriptProperty System.Object Path {get=$this.Mainmodule.FileName;}
Product ScriptProperty System.Object Product {get=$this.Mainmodule.FileVersionInfo.ProductName;}
ProductVersion ScriptProperty System.Object ProductVersion {get=$this.Mainmodule.FileVersionInfo.ProductVersion;}
PS C:\tmp> $myva2 | Get-Member -Force
TypeName: Deserialized.System.Diagnostics.Process
Name MemberType Definition
---- ---------- ----------
pstypenames CodeProperty System.Collections.ObjectModel.Collection`1[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5...
psadapted MemberSet psadapted {BasePriority, HandleCount, Id, MachineName, MainWindowHandle, MainWindowTitle, NonpagedSystemMemorySize, Nonpaged...
psbase MemberSet psbase {}
psextended MemberSet psextended {ToString, GetType, Name, SI, Handles, VM, WS, PM, NPM, Path, Company, CPU, FileVersion, ProductVersion, Descript...
psobject MemberSet psobject {BaseObject, Members, Properties, Methods, ImmediateBaseObject, TypeNames, get_BaseObject, get_Members, get_Propert...
PSStandardMembers MemberSet PSStandardMembers {DefaultDisplayPropertySet}
GetType Method type GetType()
ToString Method string ToString(), string ToString(string format, System.IFormatProvider formatProvider), string IFormattable.ToString(strin...
Company NoteProperty object Company=null
CPU NoteProperty object CPU=null
Description NoteProperty object Description=null
FileVersion NoteProperty object FileVersion=null
Handles NoteProperty int Handles=3074
Name NoteProperty string Name=aeagent
NPM NoteProperty long NPM=19232
Path NoteProperty object Path=null
PM NoteProperty long PM=6561792
Product NoteProperty object Product=null
ProductVersion NoteProperty object ProductVersion=null
SI NoteProperty int SI=0
VM NoteProperty long VM=70529024
WS NoteProperty long WS=8605696
__NounName NoteProperty string __NounName=Process
BasePriority Property System.Int32 {get;set;}
Container Property {get;set;}
EnableRaisingEvents Property System.Boolean {get;set;}
HandleCount Property System.Int32 {get;set;}
Id Property System.Int32 {get;set;}
MachineName Property System.String {get;set;}
MainWindowHandle Property Deserialized.System.IntPtr {get;set;}
MainWindowTitle Property System.String {get;set;}
NonpagedSystemMemorySize Property System.Int32 {get;set;}
NonpagedSystemMemorySize64 Property System.Int64 {get;set;}
PagedMemorySize Property System.Int32 {get;set;}
PagedMemorySize64 Property System.Int64 {get;set;}
PagedSystemMemorySize Property System.Int32 {get;set;}
PagedSystemMemorySize64 Property System.Int64 {get;set;}
PeakPagedMemorySize Property System.Int32 {get;set;}
PeakPagedMemorySize64 Property System.Int64 {get;set;}
PeakVirtualMemorySize Property System.Int32 {get;set;}
PeakVirtualMemorySize64 Property System.Int64 {get;set;}
PeakWorkingSet Property System.Int32 {get;set;}
PeakWorkingSet64 Property System.Int64 {get;set;}
PrivateMemorySize Property System.Int32 {get;set;}
PrivateMemorySize64 Property System.Int64 {get;set;}
ProcessName Property System.String {get;set;}
Responding Property System.Boolean {get;set;}
SessionId Property System.Int32 {get;set;}
Site Property {get;set;}
StartInfo Property Deserialized.System.Diagnostics.ProcessStartInfo {get;set;}
SynchronizingObject Property {get;set;}
Threads Property Deserialized.System.Diagnostics.ProcessThreadCollection {get;set;}
VirtualMemorySize Property System.Int32 {get;set;}
VirtualMemorySize64 Property System.Int64 {get;set;}
WorkingSet Property System.Int32 {get;set;}
WorkingSet64 Property System.Int64 {get;set;}
PSConfiguration PropertySet PSConfiguration {Name, Id, PriorityClass, FileVersion}
PSResources PropertySet PSResources {Name, Id, Handlecount, WorkingSet, NonPagedMemorySize, PagedMemorySize, PrivateMemorySize, VirtualMemorySize, T...
PS C:\tmp>