Search found 709 matches

by dan.potter
Fri Dec 29, 2017 6:37 am
Forum: PowerShell
Topic: Sql adapter update. Primary key constraint.
Replies: 5
Views: 3326

Re: Sql adapter update. Primary key constraint.

Unfortunately a heavily redacted $row would be as meaningfull as null :D $row is a row from a sql table, $volume is an object from netapp storage. All types in sql and the object match but some are trying to convert for unknown reasons. To make it more confusing some of the decimals, booleans work w...
by dan.potter
Fri Dec 29, 2017 5:40 am
Forum: PowerShell
Topic: Sql adapter update. Primary key constraint.
Replies: 5
Views: 3326

Re: Sql adapter update. Primary key constraint.

I guess I naively thought I could replace a datatable with a matching datatable. I did figure an easy want to loop through all the properties without insanely long update or insert statements. Though I'm stuck on this error. Any idea what's going on here? PS C:\Users> $row.TotalSize.gettype() IsPubl...
by dan.potter
Thu Dec 28, 2017 7:12 am
Forum: PowerShell
Topic: Sql adapter update. Primary key constraint.
Replies: 5
Views: 3326

Sql adapter update. Primary key constraint.

I want to perform a datatable update in the shell and I'm unsure how to automatically choose the row similar to what the datagridview does. The eventual table has forty columns and I don't want to loop through each. What I thought I could do is retrieve the sql table as a datatable. Form a new datat...
by dan.potter
Thu Nov 23, 2017 4:00 am
Forum: PowerShell GUIs
Topic: Capture ctrl+click from button not in focus?
Replies: 3
Views: 2359

Re: Capture ctrl+click from button not in focus?

I was hoping their was a simpler way within the click event.

Code: Select all

$Creds_Click={
	
	if ($ctrl) { Get-Credential | Export-Clixml $env:userprofile\cred.xml 
	
	$ctrl = $false
		
	}
	
}

$cred_keydown=[System.Windows.Forms.KeyEventHandler]{
	
	$script:ctrl = $true
}
by dan.potter
Tue Nov 21, 2017 7:59 am
Forum: PowerShell GUIs
Topic: Capture ctrl+click from button not in focus?
Replies: 3
Views: 2359

Capture ctrl+click from button not in focus?

Is it possible to do this?
by dan.potter
Tue Sep 26, 2017 5:45 pm
Forum: PowerShell
Topic: CMD to PS formatting help. Netapp install.
Replies: 10
Views: 5963

Re: CMD to PS formatting help. Netapp install.

Thanks, I was confused why I could set the here string to the clipboard and copy it into cmd and it would install without issue. I left a space at the end of each line thinking PS automatically eliminates the return. It happens with out-file too. The dsc package resource is looking for a string for ...
by dan.potter
Tue Sep 26, 2017 4:18 pm
Forum: PowerShell
Topic: CMD to PS formatting help. Netapp install.
Replies: 10
Views: 5963

Re: CMD to PS formatting help. Netapp install.

Finally got it. A single line here string did the trick. I was building a here string with all the options on a new line and the dsc config was inserting a `n after each parameter.

Alas, I still don't know why the below doesn't include the new lines.

@"
1
2
3
"@ | scb
by dan.potter
Tue Sep 26, 2017 2:57 pm
Forum: PowerShell
Topic: CMD to PS formatting help. Netapp install.
Replies: 10
Views: 5963

Re: CMD to PS formatting help. Netapp install.

Crickets over on that side :D Thanks for trying.
by dan.potter
Tue Sep 26, 2017 1:32 pm
Forum: PowerShell
Topic: CMD to PS formatting help. Netapp install.
Replies: 10
Views: 5963

Re: CMD to PS formatting help. Netapp install.

That doesn't work :cry: I know there is an underlying MSI and but I can't seem to get the msiexec arguments right either. Preferably I'd like to use the MSI itself as this will eventually be used in a dsc config.
by dan.potter
Tue Sep 26, 2017 12:33 pm
Forum: PowerShell
Topic: CMD to PS formatting help. Netapp install.
Replies: 10
Views: 5963

Re: CMD to PS formatting help. Netapp install.

I have to pass variables into the string so I don't thing single quotes is going to help.