I'm currently translating a PHP script to Powershell, and I'm stuck at the following part:
$data = array();
foreach($extension_data as $key=>$value){
array_push($data,array("name"=>$key,"value"=>$value));
}
Especially, what would the $key=>$value
part look like in PowerShell?
EDIT: here's my solution
$data = @()
foreach($e in $extension_data.getenumerator()){
$data += @{"name" = $($e.name); "value"=$($e.value)}
}
source https://stackoverflow.com/questions/70250800/translating-php-to-powershell
No comments:
Post a Comment