79822750

Date: 2025-11-17 20:37:36
Score: 3
Natty:
Report link

could we not load the ps1 into a scriptblock that would be stored in a $using context? Like:

$sb= get-content $scriptPath\with-dot-sourcing.ps1 -raw

invoke-command -ScriptBlock { . $using:sb;getMessage()}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (1):
Posted by: Michel Laporte