Here is an example:
function ChildF() { #Creating new function dynamically $DynFEx = @\" function DynF() { \"Hello DynF\" } \"@ Invoke-Expres
Another option would be to use the Set-Item -Path function:global:ChildFunction -Value {...}
Set-Item -Path function:global:ChildFunction -Value {...}
Using Set-Item, you can pass either a string or a script block to value for the function's definition.
Set-Item