i try to write a script can store the prompt i frequently use as a batch file
and i want to use the pipeline to pass the parameter
'$Variable= Import-Csv C:\Users\Administrator\demo.csv
>>
>> $attributelist= $Variable|Get-Member|Where-Object -Property MemberType -Like "*noteproperty*"|Select-Object -Property Name
>>
>>
>> class hash {
>> [string]$name
>>
>> hash ([string]$name ){
>>
>> $this.name = $name
>> }
>>
>>
>> }
>>
>> $attributelist
>>
>> [hash]::new(
>>
>> @{
>>
>> name = "1"
>> }
>> )
>> '|store.ps1
and i try the regular way
[CmdletBinding()]
param (
[Parameter()]
[string]
$ParameterName
)
Write-Host $ParameterName
'for ( ($loop=1);$loop -eq 1){
& "D:\Program Files\streamlink\bin\streamlink.exe" "https://www.twitch.tv/billibits" best
}'|& "C:\Program Files\test\store.ps1"
The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not match any of the parameters that tak
e pipeline input.
At line:3 char:4
+ }'|& "C:\Program Files\test\store.ps1"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (for ( ($loop=1)...ibits" best
}:String) [demo(5).ps1], ParameterBindingException
+ FullyQualifiedErrorId : InputObjectNotBound,demo(5).ps1