Skip to content
Advertisement

Tag: powershell

diff compare directories by filename only

Is it possible to use any sort of diff utility to diff based on filename only, excluding the file extensions? I have multiple dirs that have various versions of a file, ie media.mov, media.mp4, media.jpg, etc. I want to make sure all versions were made for each file (1000s). So /dir1/media_99.mov and /dir2/media_99.mp4 would yield a TRUE condition. Man diff

Powershell for Linux: Combining commands with pipe sign doesn’t work

Any way to concatenate commands in Powershell for Linux? This is what I’m trying to run: pwsh -Command Invoke-ScriptAnalyzer -Path . | ConvertTo-Json | Out-File -FilePath “/home/administrator/scripts/test.json” So, run the Invoke-ScriptAnalyzer, convert the results to Json and save the result to test.json. It doesn’t recognize anything after the | sign: ./test.sh: line 1: ConvertTo-Json: command not found ./test.sh: line 1:

Powershell Linux Sharepoint Management

I installed powershell (pwsh) on Ubuntu 20.4. I am trying to manage some Sharepoint stuff. I did the following: And it installed. So, I thought. I cannot access any commands, such as Get-SPOSiteDesign, etc. I list the modules I have: From the following result, it seems the problem is that there are not any ExportedCommands from the Microsoft.Online.SharePoint.PowerShell package. What

Cannot convert string to boolean – ansible to powershell on linux

I read this whole thread about how to pass boolean values to a parameter to powershell on Linux. Nothing worked for me. My code in Ansible is as follows: I’ve used many variants, such as -ParticipateInCEIP:False, or -ParticipateInCEIP False, or -ParticipateInCEIP $false, but I get always the same error, that it expects boolean, but I sent string. I am running

Invoke-WebRequest Always Fails For HTTPS. The remote certificate is invalid according to the validation procedure

I’m trying to use Invoke-WebRequest inside of pwsh (on Linux), but it’s always failing. Here’s an example: The site/URL doesn’t matter, if it’s using HTTPS I’ll get the error. The exact same script on a Windows machine works without issue. $PSVersionTable dotnet –version 3.1.403 openssl version OpenSSL 1.0.1e-fips 11 Feb 2013 I know it’s possible to disable SSL validation on

How to convert this powershell script to bin/sh script?

How to convert this script: or with parameter: How to make similar script that works in linux /bin/sh? I want to copy files to some network location (windows shared folder). There is no scp on windows server and i cannot install anything. Answer On Linux, you’ll need the following (verified on Ubuntu 18.04, albeit not with a Windows domain account):

How to compare two files containing many long strings then extract lines with at least n consecutive identical chars?

I have 2 large files each containing long strings separated by newlines in different formats. I need to find similarities and differences between them. The Problem is that the formats of the two files differ. File a: File b: So now I want to extract the whole line containing NjA5MDAxNdaeag0NjE5NTIx.XUwXRQ.gat8MzuGfkj2pWs7z8z-LBFXQaE from File a to a new file and also delete

Powershell for Linux: Workaround for missing “out-gridview”?

In Aug 2016, Microsoft’s Powershell went open-source. However, there is no “out-gridview” option yet. The autocompletion feature shows these Out* options Note that there is no Out-Gridview at this time. Did I overlook a feature, commandlet that can do something similar? Sometimes I’d ike to have my tabular data displayed in a sortable GUI Window (for showing something to windows

Advertisement