• /r/csharp
  • WCF client set default RequestFormat?

    I am trying to create a WCF client from a shared DLL that has ServiceContract interfaces and WebGet/WebInvoke methods. I am using a WebChannelFactory to create a channel for the services. I know I can add a “RequestFormat=WebMessageFormat.Json” to every method, but I have a very large number of methods, and it seems like a […]

  • /r/powershell
  • Logging into a webpage

    I’ve written scripts to login to webpages before, but I’m having a problem with a particular page. When I click the login button through my script, I receive an error message that “We cannot log you in at this time.” Logging in manually works fine. I’m sure it’s my own lack of knowledge but I […]

  • /r/powershell
  • Quick Question on Printers

    Hey guys, I’m just now learning Powershell as I’m the IT guy here for the company and I’m messing around with some commands. I’m still not exactly sure if I’m reading the errors correctly, so maybe someone could take a look and help me out. We have a printer on our network, which is installed […]

  • /r/powershell
  • Windows.Forms.Clipboard issues

    I am having problems retrieving an image from my clipboard. The printscreen press works, as I can paste into MS paint. Tried increasing the wait time to 1500 and that didn’t help. ContainsImage() returns false, and GetImage() doesn’t pull anything. Any advice appreciated. Add-Type -AssemblyName System.Windows.Forms Start-Sleep -Milliseconds 250 [Windows.Forms.Sendkeys]::SendWait(“%{PrtSc}”) Start-Sleep -Milliseconds 500 [Windows.Forms.Clipboard]::ContainsImage() $bitmap […]

  • /r/powershell
  • PowerCLI Owner Tag Report

    Got a request from management to create a report that would break out vm’s per owner. They also wanted to separate Prod vs nonprod. This is what I came up with. Feel free to use it. I’m a below average programmer at best, so I thought I’d see if you guys see any glaring improvements. […]