windows – Powershell Import-VM from the folder, not from the XML file

I have exported a virtual machine that I created in the Hyper-V administrator in Windows 10.
The result is a folder with machine files, snapshots and hdd.

Now I have to import this virtual machine in a central server 2019, through powershell.

However, the Import-VM cmdlet requires an XML file as input, something that the Hyper-V administrator that previously occurred when exporting seems to remember.

Am I missing something? Should I use a different cmdlet, or is it supposed that the export should still produce that XML file and for some reason I'm not getting it?

Thank you

sharepoint online – How to overwrite the version of a file using CSOM?

When I register as a main version or a secondary version, I create the new version as main. Below is the code:

static void private file UploadFiles (string sourceFileUrl, Folder targetFolder, string fileName, ClientContext clientContext, ClientContext destinationContext, bool bolMajorVersion)

FileCreationInformation targetFileVersionCreationInfo = new FileCreationInformation ();
targetFileVersionCreationInfo.Overwrite = true;
Web request request = HttpWebRequest.Create (sourceFileUrl);
request.Credentials = clientContext.Credentials;
using (response from WebResponse = request.GetResponse ())
using (Stream Stream = response.GetResponseStream ())
byte[] verBuffer = new byte[32768];
using (MemoryStream versionMS = new MemoryStream ())
Int read
while ((read = stream.Read (seeBuffer, 0, seeBuffer.Length))> 0)
versionMS.Write (seeBuffer, 0, read);
versionMS.Seek (0, SeekOrigin.Begin);
targetFileVersionCreationInfo.ContentStream = versionMS;
destinationContext.RequestTimeout = System.Threading.Timeout.Infinite;
targetFileVersionCreationInfo.Url = targetFolder.ServerRelativeUrl + "/" + fileName;
Microsoft.SharePoint.Client.File targetVersionFile = targetFolder.Files.Add (targetFileVersionCreationInfo);

File Microsoft.SharePoint.Client.File = targetVersionFile;
// Checkout if you are registered
destinationContext.Load (file);

destinationContext.ExecuteQuery ();

if (file.CheckOutType == CheckOutType.None)
file.CheckOut ();
// ListItem lstItem = file.ListItemAllFields;
//clientContext.ExecuteQuery ();
yes (bolMajorVersion)

file.CheckIn ("Uploaded through the portal", CheckinType.MajorCheckIn);

// Overwrite to avoid creating a new version.
file.CheckIn ("Uploaded through the portal", CheckinType.MinorCheckIn);
destinationContext.ExecuteQuery ();
// destinationContext.ExecuteQuery ();

catch (ex exception)
// handle the exception

The file is initially loaded with version 0.1 after registering as a major version, creating a new version 1.0 and also maintaining version 0.1. I need to overwrite this file from version 0.1.

Any help should be appreciated.

sql server: if I move my SQL data file from my F drive, I delete the F drive and change the name of the new F drive, will I have any problem with the file path?

I have a Windows server that only had 50 GB in the C drive and 4 TB in the F drive. I need to expand the C drive, but the only way to do that is by removing the F drive to reallocate space. If I move data from the F drive to a new drive, I delete the F drive and rename the new drive, will I lose the file path?

Deletion of duplicate audio files with different UTC time stamps in the file names, using PowerShell 5

I have a disc with many thousands of sound effects. The files have been stored on different operating systems and NAS devices over time and now there are duplicates of many files, but the names of the files contain different UTC timestamps. For example:

1-14 Busted bowling alley (2016_06_28 02_14_41 UTC) .aif

1-14 Bowling full of people (2016_02_18 05_56_59 UTC) .aif

I would like to delete the duplicate files. There are also unwanted files from the audio software and the indexing of the operating system that I would like to remove. When using a subset copied data, I tried the following PowerShell script in PS version 5.1, it seems to give me what I'm looking for:

# Remove the remaining files from the audio editors
Get-ChildItem -Name -Recurse -Filter "* .clip *" | Remove the article
Get-ChildItem -Name -Recurse -Filter "* .ptf" | Remove the article
Get-ChildItem -Name -Recurse -Filter "* .wfm" | Remove the article
Get-ChildItem -Name -Recurse -Filter "* .repeaks" | Remove the article

# Delete old indexing files
Get-ChildItem -Name -Recurse -Filter "* .DS_STORE" | Remove the article
Get-ChildItem -Name -Recurse -Filter "._. *" | Remove the article
Get-ChildItem -Name -Recurse -Filter "Thumbs * .db" | Remove the article
Get-ChildItem -Name -Recurse -Filter "* .ini" | Remove the article

# Remove UTC stamp of all files (will fail in duplicates)
Get-ChildItem -Recurse -Filter "* (?????????? ???????? UTC). *" | Rename-element-new name {$ _. Basename.substring (0, $ _. Basename.length-26) + $ _. Extension}

# Delete files that still have the UTC stamp (they were the duplicates)
Get-ChildItem -Name -Recurse -Filter "* (?????????????????? UTC). *" | Remove the article

However, I would love to get a critique of the script and learn some things. In particular, it seems a bit hacked using an expected failed command as part of the workflow. It also seemed sensible to get notes before executing it in the whole set of files.

Is it possible to recover a deleted file with the -r command on a linux server?

I made a very serious mistake. I was editing the crontab file of my remote server, I was as the root user and it turns out that I wrote "crontab -r" instead of "crontab -e" and without previous notice it was simply deleted. I was looking for information and it turns out that files deleted with the -r command are not stored somewhere like the recycle bin or something similar. I am very worried because there are scheduled backups and all the scripts that my hosting placed. I already communicate with them and I must wait for a response from a specialized person in a period of 24 to 48 hours, but I am very concerned. Has anyone had a similar experience? will it be possible to recover that file?

magento2 – Magento 2 passes data from the html template to the phtml file

file So far I have created MyModule / ProductAlert / view / frontend / email / stock.html

{{template config_path = "design / email / header_template"}}

{{var alertGrid | raw}

{{template config_path = "design / email / footer_template"}}

And I would like to transmit my variables email a .phtml file in
MyModule / ProductAlert / view / frontend / templates / email / stock.phtml and call it there


    getProducts ()):?>

Your e-mail: getData (& # 39; email & # 39;)?>

// Email should be here

Currently, he returns nothing to me. How can I achieve that? Thank you!

.htaccess: How to add / ignore a subfolder in the htaccess file?

I have built an application in http: // url / sdf19 /

I have a .htaccess placed in / sdf19 / containing RewriteRule for clean URLs.

But I have built a PDF generation tool, which is in a subfolder / inc / tools.
I need to link it directly to run before the headers.

Despite some hours of searching, testing fragments, generators, etc. I can not get any request for http: // url / sdf19 / inc / tools to be allowed, without the existing RewriteRule set taking control

Here is my home file


RewriteRule ^ ([a-z]+)  /? $ index.php? page = $ 1 [NC]
RewriteRule ^ ([a-z]+)  / ([0-9]+)  /? $ index.php? page = $ 1 & id = $ 2 [NC]
RewriteRule ^ ([a-z]+)  / ([a-z]+)  /? $ index.php? page = $ 1 & action = $ 2 [NC]
RewriteRule ^ ([a-z]+)  / ([a-z]+)  / ([0-9]+)  /? $ index.php? page = $ 1 & action = $ 2 & id = $ 3 [NC]


I have tried adding this on line 4;
RewriteCond% {REQUEST_URI}! ^ Inc / tools / [NC]

This gave RewriteCond: bad argument line error

I have tried adding this to line 2;

RewriteCond% {REQUEST_URI} ^ / inc / tools /(.*)$
RewriteRule ^. * $ - [L]

I have tried adding a .htaccess in / inc / tools with RewriteEngine OFF, it did not work.

I have tried the linked .htaccess tester in the top post, but its file (above) works IRL, it produces a & # 39; rule that is not met & # 39; for everything it contains!


The desired result is that I can allow direct access to http: // url / sdf19 / inc / tools > everything I've tried so far redirects me to the base http: // url / sdf19 /

2013 – Create the compilation file of the react application has a character ~ not valid for SP

Stack exchange network

The Stack Exchange network consists of 175 question and answer communities including Stack Overflow, the largest and most reliable online community for developers to learn, share their knowledge and develop their careers.

Visit Stack Exchange

How to recompress the sqlite file as a .jet file

I have a .sqlite file and the developer compresses it as a .jet file. Now I can open it with 7zip, I can edit the database but in the end I could not recompress it as a .jet file. I tried all the solutions I saw on the internet, but none of them answered me.

If someone wants to take a look, download the download link.

Any help would be great.

How to organize the file of family videos? – Everything else

How to organize the file of family videos? Many gigabytes of videos from familiar files have been put together on the hard drive. In the video file not all videos are useful. There are interesting plots. Is it possible to cut out such videos and leave important and interesting details? Is it possible to collect several video files in one?