Get around 260 char limit

So I have a script that finds all shortcuts on my file server and removes them. And F***ing loads of files paths are over the 260 char limit. Users huh? Anyways, can anyone suggest a workaround for the 260 char limit. $share = Get-ChildItem ‘<filePath>’ -Recurse | Where { $_.PsIsContainer -eq $False } $share | […]

What are the best options for replacing large switch statements in 2019

I am revisiting some code in a Fiddler extension. It provides validation for all sessions related to our API. The extension has what are effectively nested switch statements for matching different URLs and other criteria, and then provides suggestions for fixing the problem. Dispatching using a dictionary or the command pattern seem like popular solutions […]

Posted this yesterday. Hope it just got overlooked. I really need help trying to figure out how to surpress the “save as” prompt when trying to print to PDF

I just want to print somefile.txt to somefile.pdf Using this code (sry for bad formatting I’m on mobile ) $target = “C:temp” foreach($item in Get-ChildItem -Path $target -Filter *.txt) { $SaveAs = $ (Get-WmiObject -Class Win32_Printer -Filter”Name=’Microsoft Print to PDF'”).SetDefaultPrinter() Start-Process $target$SaveAs -Verb Print -ErrorAction Stop -WindowStyle Hidden } submitted by /u/KingBeef4 [link] [comments]

Compiling a .Net Core Console App with Npgsql and CoreRT

I’m trying to compile a .net core console application into native executable (linux-x64) on an ubuntu 18.04 docker container, using both coreRT and Npgsql. I’m currently using docker-compose to set up the DB and application containers. docker-compose.yml “` version: ‘3’ services: database: image: postgres:10 environment: – POSTGRES_USER=dbuser – POSTGRES_PASSWORD=dbpassword – POSTGRES_DB=dbsample ports: – 5432:5432 tmpfs: […]

postman POST file working fine, but client side POST file is failing in the API with a SQL exception

I’m trying to POST a file from the client to a blob in AZURE. Here is my API and service worker. [HttpPost(“furniture/image/{furnitureId}”)] public async Task<IActionResult> UploadFile(IFormFile image) { int furnitureId = Convert.ToInt32(RouteData.Values[“furnitureId”]); var furnitureImage = new FurnitureImage(); if (ModelState.IsValid) { if (image != null && image.Length > 0) { using (Stream stream = image.OpenReadStream()) { […]

Force windows updates

So I work for a big organization where everything is re packaged and that includes windows. So windows update also comes from some internal distribution server. What I want to do is to Force windows check for updates, and install any (I want to specify KB names) missing updates. I want to specify the missing […]