Category : powershell

I want to copy all the files/folders from a docker folder into local (for some testing purpose). I tried running docker command container cp valuenet:/. ./VNet/ , which seems to work partially. It copies a few files and then gives me the following error: : The filename, directory name, or volume label syntax is incorrect.hraseIcon ..

Read more

I’m trying to adapt this script that is called through a contextual menu: Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOTAllFilesystemObjectsshellRenameWithTimestamp] @="Rename: Add Date Modified" [HKEY_CLASSES_ROOTAllFilesystemObjectsshellRenameWithTimestampCommand] @="PowerShell.exe -WindowStyle Hidden -Command "( Get-Item -LiteralPath ‘%1’ ) | %%{ Rename-Item -LiteralPath $_.FullName -NewName ( ‘{0:yyyyMMdd_HHmmss} {1} {2}’ -f $_.LastWriteTime,$_.BaseName, $_.Extension ) }"" I would like to be able to ..

Read more

I’m after the Windows equivalent of the Linux rm -rfvd <folder-to-empty> command. That is, unconditionally remove all files and subdirectories (empty or otherwise) in a given directory without prompt or warning. I appreciate that might be a dangerous thing to do, but my particular context is a task in a non-interactive automated build workflow. I ..

Read more

I want to be able to use command line (scripts) on a Win10 machine to mute, unmute or change the volume level of any given application that is displayed in my Windows Volume Mixer. After quite some time of researching I only found tools such as NirSoft’s SoundVolumeView (https://www.nirsoft.net/utils/sound_volume_view.html), but no generic explanation of how ..

Read more

We want to migrate a lot of SharePoint 2010 environments to 2019. And to do so we need to arrange for 3 environments;SharePoint 2013, 2016 and 2019. So to fasten this process can we write a power shell script which we can run on each server and it will install the SharePoint 2013, 2016 and ..

Read more

I have .NET Core 2.2 application with Docker support. The Dockerfile is: FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-nanoserver-1803 AS base WORKDIR /app EXPOSE 80 FROM mcr.microsoft.com/dotnet/core/sdk:2.2-nanoserver-1803 AS build WORKDIR /src COPY ["sample-app.csproj", ""] RUN dotnet restore "sample-app.csproj" COPY . . WORKDIR "/src/" RUN dotnet build "sample-app.csproj" -c Release -o /app FROM build AS publish RUN dotnet publish "sample-app.csproj" -c ..

Read more

I am trying to figure out what are the differences between WUA (Windows Update Agent API) IupdateSearcher and wmic qfe list. When I use WUA IupdateSearcher I get these updates: (New-Object -ComObject Microsoft.Update.Session).CreateUpdateSearcher().Search(‘IsInstalled=1′).Updates | Format-Table -AutoSize And when using wmic qfe list: wmic qfe list brief The latter includes updates that the former doesn’t and ..

Read more