How to concat/append multiple returned rows into only one row?

I have query which returns this result: +—————————————–+ | product_english | +—————————————–+ | can of orange juice | | oatmeal container | | milk bottle 28 oz | | chocolate powder no sugar added – 16 oz | | instant coffee 8 oz container | | almonds bag 25 oz. | +—————————————–+ it would return… Read More How to concat/append multiple returned rows into only one row?

C# – Can't get this seemingly simple web request working

I have the following powershell Web-Request that works correctly for sending a command to a PTZ camera: Invoke-WebRequest -UseBasicParsing -Uri "http://192.168.111.75/ajaxcom" ` -Method "POST" ` -Headers @{ "Accept"="application/json, text/javascript, */*; q=0.01" "Accept-Encoding"="gzip, deflate" "Accept-Language"="en-US,en;q=0.9" "DNT"="1" "Origin"="http://192.168.111.75" "X-Requested-With"="XMLHttpRequest" } ` -ContentType "application/x-www-form-urlencoded; charset=UTF-8" ` -Body "szCmd=encodedStringHere" I’m trying to recreate this in C# but I can’t… Read More C# – Can't get this seemingly simple web request working

I am trying to fetch information from phpmyadmin database, but in browser it's showing cannot get/employee and in command prompt there is no error

const { json } = require(‘express/lib/response’); const mysql=require (‘mysql’); const express=require(‘express’); var app=express(); const bodyparser=require(‘body-parser’); app.use(bodyparser.json()); var mysqlConnection=mysql.createConnection({ host:’localhost’, user: ‘root’, password:”, database: ’employee_db’ }); mysqlConnection.connect((err)=>{ if(!err) { console.log("DB connection is successfull"); } else{ console.log("DB connection failed "+JSON.stringify(err,undefined,2)); } }); app.listen(8000,()=>console.log(‘Express server is running on port number: 8000’)); app.get(‘/employess’,(res,req)=>{ mysqlConnection.query(‘SELECT * FROM EMPLOYEE’,(err,rows,fields)=>{ if(!err) {… Read More I am trying to fetch information from phpmyadmin database, but in browser it's showing cannot get/employee and in command prompt there is no error

How to run a PowerShell cmdlet in Python to get a list of connected USB devices?

I try to list connected USB devices in my Python project. I tried to use os.system() with a command prompt but I cannot find a command for command prompt to list connected USB devices (names). I found a PowerShell command which is Get-PnpDevice -PresentOnly | Where-Object { $_. InstanceId -match ‘^USB’ } That works fine.… Read More How to run a PowerShell cmdlet in Python to get a list of connected USB devices?

Basic concatenation in Powershell doesn't work

I cannot push to $filepaths, can’t see why : $filepaths=@() $files= @(‘file1.text’,’file2.txt’) foreach ($file in $files) { $filepaths.add("c:\test\" + $file) } $filepaths >Solution : @() is a System.Array (a fixed collection), reading from Remarks on the .Add method from this Class: Ordinarily, an IList.Add implementation adds a member to a collection. However, because arrays have… Read More Basic concatenation in Powershell doesn't work

Powershell regex group : how do I get all subgroups 2

I want to extract file1, file2 I know how to do this in javascript, I’m lost in Powershell, I can only extract the whole second match following that tut https://devblogs.microsoft.com/scripting/regular-expressions-regex-grouping-regex/, what’s the syntax ? $regex = ‘(.+\\)*(.+)\.(.+)$’ $data = @’ "C:\test\file1.txt" "C:\test\file2.txt" ‘@ [RegEx]::Matches($data,$regex).value >Solution : Here is how you could do it using the… Read More Powershell regex group : how do I get all subgroups 2

Saving various files in different folders into one single folder using powershell

I have a 3 folders here with 3 files. Within each there is a csv file, I want to save them all into a destination folder without having to open each folder and drag and drop the file into the destination folder. I attempted this. $destination = "C:\Desktop\Test" $sourcefiles = get-childitem -recurse foreach ($file in… Read More Saving various files in different folders into one single folder using powershell