corecycler icon indicating copy to clipboard operation
corecycler copied to clipboard

script-corecycler.ps1 can't run with powershell 7

Open Lincutt opened this issue 2 years ago • 2 comments

it will throw a lot of error and leave. the attach file is the error log.

Update-TypeData: D:\CoreCycler-v0.9.0.0\script-corecycler.ps1:245 Line | 245 | Update-TypeData -TypeName System.Collections.HashTable ` | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Error in TypeData "System.Collections.Hashtable": The member ToString is already present.

Starting the CoreCycler...

-------------- CoreCycler v0.9.0.0 started at 2022-09-07 02:08:40 --------------

Log Level set to: ......... 1 [Writing verbose messages to log file] Stress test program: ...... PRIME95 Selected test mode: ....... AVX2 Logical/Physical cores: ... 16 logical / 8 physical cores Hyperthreading / SMT is: .. ON Selected number of threads: 2 Runtime per core: ......... AUTOMATIC Suspend periodically: ..... ENABLED Restart for each core: .... OFF Test order of cores: ...... DEFAULT (RANDOM) Number of iterations: ..... 1 Ignored cores: ............ 4, 5

Selected FFT size: ........ 4-256 (4K - 256K)


The log files for this run are stored in: D:\CoreCycler-v0.9.0.0\logs\

  • CoreCycler: CoreCycler_2022-09-07_02-08-37_PRIME95_AVX2.log
  • Prime95: Prime95_2022-09-07_02-08-37_AVX2_4-256_FFT_4K-256K.txt

02:08:43 - Iteration 1

02:08:43 - Set to Core 7 (CPU 14 and 15) Running until all FFT sizes have been tested... 02:09:44 - Terminating the script... Trying to close the stress test program... InvalidOperation: D:\CoreCycler-v0.9.0.0\script-corecycler.ps1:887 Line | 887 | $assembly = $domain.DefineDynamicAssembly($name, 'Run') | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Method invocation failed because [System.AppDomain] does not contain a method named 'DefineDynamicAssembly'.

InvalidOperation: D:\CoreCycler-v0.9.0.0\script-corecycler.ps1:889 Line | 889 | $module = $assembly.DefineDynamicModule('PInvokeModule') | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | You cannot call a method on a null-valued expression.

InvalidOperation: D:\CoreCycler-v0.9.0.0\script-corecycler.ps1:890 Line | 890 | $type = $module.DefineType('PInvokeType', "Public,BeforeField … | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | You cannot call a method on a null-valued expression.

InvalidOperation: D:\CoreCycler-v0.9.0.0\script-corecycler.ps1:921 Line | 921 | $method = $type.DefineMethod($methodName, 'Public,HideBySig,Stati … | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | You cannot call a method on a null-valued expression.

InvalidOperation: D:\CoreCycler-v0.9.0.0\script-corecycler.ps1:930 Line | 930 | $method.SetCustomAttribute($attr) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | You cannot call a method on a null-valued expression.

InvalidOperation: D:\CoreCycler-v0.9.0.0\script-corecycler.ps1:933 Line | 933 | $realType = $type.CreateType() | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | You cannot call a method on a null-valued expression.

InvalidOperation: D:\CoreCycler-v0.9.0.0\script-corecycler.ps1:934 Line | 934 | $realType.InvokeMember($methodName, 'Public,Static,InvokeMethod', … | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | You cannot call a method on a null-valued expression.

Please check if the selected stress test program "Prime95" is still running! Check for these processes:

  • prime95.exe

------ Summary ------

The script ran for 01 minutes, 08 seconds No core has thrown an error Suspend-ProcessWithDebugMethod: D:\CoreCycler-v0.9.0.0\script-corecycler.ps1:4820 Line | 4820 | … $suspended = Suspend-ProcessWithDebugMethod $stressTestProcess | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Method invocation failed because [System.AppDomain] does not contain a method named 'DefineDynamicAssembly'. CoreCycler_2022-09-07_02-08-37_PRIME95_AVX2.log

Lincutt avatar Sep 06 '22 18:09 Lincutt

I just installed PowerShell 7.2.6, and yeah, the script doesn't seem to be compatible with it. I'm seeing all sorts of errors. Even Get-WMIObject doesn't seem to be working for me as well (it does seem to for you though).

I'm afraid currently it only works with PS 5.1. Version 7 (and probably v6 even more so) don't seem to support all required Cmdlets yet. Maybe it's possible to rewrite it for PS7, I'm not sure, I haven't looked into it, and currently I don't really have much plans to do so.

PowerShell 5.1 should always be available on Windows though anyways, so currently it would only be nice to have / future proofing.

sp00n avatar Sep 06 '22 19:09 sp00n

I just installed PowerShell 7.2.6, and yeah, the script doesn't seem to be compatible with it. I'm seeing all sorts of errors. Even doesn't seem to be working for me as well (it does seem to for you though).Get-WMIObject

I'm afraid currently it only works with PS 5.1. Version 7 (and probably v6 even more so) don't seem to support all required Cmdlets yet. Maybe it's possible to rewrite it for PS7, I'm not sure, I haven't looked into it, and currently I don't really have much plans to do so.

PowerShell 5.1 should always be available on Windows though anyways, so currently it would only be nice to have / future proofing.

thanks for your reply. it works fine with windows powershell that built in win11. so that's okay :)

Lincutt avatar Sep 06 '22 20:09 Lincutt