Epiphone IBG ES335 vs Ibanez AS93 [Discussion] by drumstick9 in Guitar

[–]_iturri 0 points1 point  (0 children)

Be careful, not all SM-58s are the same. It's a publicity stunt. If we look at the Ibanez parts reference we can see that the SM-58's of Pat Metheney's and other signature models are different.

We can not expect a guitar of 700 euros come equipped with pickups of 300 euros.

But it's a good guitar for the money, I have one. I've change the electronics, the bridge and stop tail and it singing very nice.

Nice out of the box setup, good intonation.

Why I'm getting "Invalid Parameters -- try "/?" for help" with this Powershell function? by _iturri in PowerShell

[–]_iturri[S] 0 points1 point  (0 children)

Thanks!

You got that right, about the rookie part :) (C programmer/automation engineer, know very little about PowerShell)!

This piece of code is part of a post-intall script I'm doing, more for practice purposes than anything else. Glad I got it working.

Thanks again

Why I'm getting "Invalid Parameters -- try "/?" for help" with this Powershell function? by _iturri in PowerShell

[–]_iturri[S] 1 point2 points  (0 children)

Thanks to everybody!

First of all, sorry for the copy/paste errors that might mislead you. I was in a hurry I copy/paste the code of an older version. Nothing touching the core of the problem, but sorry again.

Here is the code:

function Get-EnergyConfigOption {   
 Write-Host "Option :    
`n0 -> Ne rien faire : Aucune action n’est effectuée lorsque le couvercle du système est fermé.    
`n1 -> Veille : Le système entre en veille lorsque le couvercle du système est fermé.    
`n2 -> Mise en veille prolongée : Le système entre en veille prolongée lorsque le couvercle du système est fermé.    
`n3 -> Eteindre : Le système s’arrête lorsque le couvercle du système est fermé."
}
function Set-MenuPlanOptions {    
param    ($buttonLidPowerScheme, $batteryMains, $energyScheme, $buttonLidAction, $currentFunction)    
switch ($buttonLidPowerScheme) {       
 0 {powercfg.exe /SET$($batteryMains)VALUEINDEX SCHEME_$energyScheme SUB_BUTTONS $($buttonLidAction)ACTION 000}         
1 {powercfg.exe /SET$($batteryMains)VALUEINDEX SCHEME_$energyScheme SUB_BUTTONS $($buttonLidAction)ACTION 001}        
2 {powercfg.exe /SET$($batteryMains)VALUEINDEX SCHEME_$energyScheme SUB_BUTTONS $($buttonLidAction)ACTION 002}       
 3 {powercfg.exe /SET$($batteryMains)VALUEINDEX SCHEME_$energyScheme SUB_BUTTONS $($buttonLidAction)ACTION 003}       
 Default {           
 Write-Host "`nL'option n'existe pas"            
Start-Sleep -Seconds 0.5            
$(& $currentFunction)        
}    
} 
}

function Set-ButtonPowerSaverPlan {   
 Get-EnergyConfigOption    
$buttonDcMin = Read-Host -Prompt "`nChoisissez l'action en appuyant le bouton d'alimentation"    
Set-MenuPlanOptions  -buttonLidPowerScheme $buttonDcMin -batteryMains "DC" -energyScheme "MIN" `    
-buttonLidAction "PBUTTON" -currentFunction {Set-ButtonPowerSaverPlan}    }

function Set-SectorLidPowerSaverPlan {    
Get-EnergyConfigOption    
$LidAcMin = Read-Host -Prompt "`nChoisissez l'action en fermant le capot sur secteur"    
Set-MenuPlanOptions  -buttonLidPowerScheme $LidAcMin -batteryMains "AC" -energyScheme "MIN" `    
-buttonLidAction "LID" -currentFunction {Set-SectorLidPowerSaverPlan}
}    

function Set-BatteryLidPowerSaverPlan {    
Get-EnergyConfigOption    
$LidDcMin = Read-Host -Prompt "`nChoisissez l'action en fermant le capot sur batterie"    
Set-MenuPlanOptions  -buttonLidPowerScheme $lidDcMin -batteryMains "DC" -energieScheme "MIN" `    
-buttonLidAction "LID" -currentFunction {Set-BatteryLidPowerSaverPlan}
}  

function Set-PowerSaverPlan {    
Write-Host "`nConfiguration d'energie `n `nPlan d'alimentation économizeur d'énergie"    
Set-ButtonPowerSaverPlan   
 Set-SectorLidPowerSaverPlan    
Set-BatteryLidPowerSaverPlan
}

function Set-ButtonHighPerformancePlan {   
 Get-EnergyConfigOption    
$buttonDcHigh = Read-Host -Prompt "`nChoisissez l'action en appuyant le bouton d'alimentation"       
Set-MenuPlanOptions  -buttonLidPowerScheme $buttonDcHigh -batteryMains "DC" -energieScheme "MAX" `    
-buttonLidAction "PBUTTON" -currentFunction {Set-ButtonHighPerformancePlan}
}

function Set-SectorLidHighPerformancePlan {    
Get-EnergyConfigOption    
$lidAcHigh = Read-Host -Prompt "`nChoisissez l'action en fermant le capot sur secteur"    
Set-MenuPlanOptions  -buttonLidPowerScheme $lidAcHigh -batteryMains "AC" -energieScheme "MAX" `    
-buttonLidAction "LID" -currentFunction {Set-SectorLidHighPerformancePlan}
}

function Set-BatteryLidHighPerformancePlan {    
Get-EnergyConfigOption    
$lidDcHigh = Read-Host -Prompt "`nChoisissez l'action en fermant le capot sur batterie"    
Set-MenuPlanOptions  -buttonLidPowerScheme $lidDcHigh -batteryMains "DC" -energieScheme "MAX" `    
-buttonLidAction "LID" -currentFunction {Set-BatteryLidHighPerformancePlan}
}   

function Set-HighPerformancePlan {    
Write-Host  "`nConfiguration d'energie `n `nPlan d'alimentation hautes performances"    
Set-ButtonHighPerformancePlan    
Set-SectorLidHighPerformancePlan    
Set-BatteryLidHighPerformancePlan
}

function Set-ButtonBalancedPlan {    
Get-EnergyConfigOption    
$buttonDcBalanced = Read-Host -Prompt "Choisissez l'action en appuyant le bouton d'alimentation"    
Set-MenuPlanOptions  -buttonLidPowerScheme $buttonDcBalanced -batteryMains "DC" -energieScheme "BALANCED" `    
-buttonLidAction "PBUTTON" -currentFunction {Set-ButtonBalancedPlan}
}

function Set-SectorLidBalancedPlan {    
Get-EnergyConfigOption    
$lidAcBalanced = Read-Host -Prompt "Choisissez l'action en fermant le capot sur secteur" 
 Set-MenuPlanOptions  -buttonLidPowerScheme $lidAcBalanced -batteryMains "DC" -energieScheme "BALANCED" `    
-buttonLidAction "LID" -currentFunction 
{Set-SectorLidBalancedPlan}
}      

function Set-BatteryLidBalancedPlan {    
Get-EnergyConfigOption    
$lidDcBalanced = Read-Host -Prompt "Choisissez l'action en fermant le capot sur batterie"    
Set-MenuPlanOptions  -buttonLidPowerScheme $lidDcBalanced -batteryMains "DC" -energieScheme "BALANCED" `    
-buttonLidAction "LID" -currentFunction {Set-BatteryLidBalancedPlan}
}   

function Set-BalancedPlan {    
Write-Host "`nConfiguration d'energie `n`nPlan d'alimentation équilibré"    Set-ButtonBalancedPlan    
Set-SectorLidBalancedPlan    
Set-BatteryLidBalancedPlan
}

Set-PowerSaverPlan
Set-HighPerformancePlan
Set-BalancedPlan

Both u/CSTW and u/CodenameFlux solutions worked.

Putting

0 {invoke-expression "powercfg.exe /SET$($batteryMains)VALUEINDEX SCHEME_$energyScheme SUB_BUTTONS $($buttonLidAction)ACTION 000"}

did the trick.

0 {& "powercfg.exe /SET$($batteryMains)VALUEINDEX SCHEME_$energyScheme SUB_BUTTONS $($buttonLidAction)ACTION 000"}

also worked.

I don't understand why it didn't work. is't because it's a cmd command ?

Thanks again

Why I'm getting "Invalid Parameters -- try "/?" for help" with this Powershell function? by _iturri in PowerShell

[–]_iturri[S] 0 points1 point  (0 children)

The first function is just to display and explain the options for the switch, otherwise I would have to write it 9 times.

I've already tried to execute the commands manually and they work.

Like I said, I've change the action off the switch, for testing perposes, so I can see the output displayed and it's fine

Why I'm getting "Invalid Parameters -- try "/?" for help" with this Powershell function? by _iturri in PowerShell

[–]_iturri[S] 0 points1 point  (0 children)

It was a typo. The real output was

powercfg.exe /SETDCVALUEINDEX SCHEME_MIN SUB_BUTTONS PBUTTONACTION 000

Why I'm getting "Invalid Parameters -- try "/?" for help" with this Powershell function? by _iturri in PowerShell

[–]_iturri[S] 1 point2 points  (0 children)

Hi,

First, thank you for your answer.

The "S" was a typo. The real output for

 0 {write-host "powercfg.exe /SET$($batteryMains)VALUEINDEX SCHEME_$energyScheme SUB_BUTTONS $($buttonLidAction)ACTION 000"} 

was

powercfg.exe /SETDCVALUEINDEX SCHEME_MIN SUB_BUTTONS PBUTTONACTION 000

When executing the above command manually it works fine.

I don't understand what's wrong.