Skip to content

Commit

Permalink
Commit from GitHub Actions (Build Documentation Site)
Browse files Browse the repository at this point in the history
  • Loading branch information
erwinvanhunen committed Dec 23, 2023
1 parent 4798d08 commit f9896dc
Show file tree
Hide file tree
Showing 6 changed files with 477 additions and 2 deletions.
263 changes: 263 additions & 0 deletions cmdlets/Convert-PnPFile.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,263 @@
<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html lang="en">

<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>Convert-PnPFile | PnP PowerShell </title>
<meta name="viewport" content="width=device-width">
<meta name="title" content="Convert-PnPFile | PnP PowerShell ">
<meta name="generator" content="docfx ">
<meta name="description" content="PnP PowerShell is an open source, community driven, PowerShell Module designed to work with Microsoft 365.">
<link rel="shortcut icon" href="https://c.s-microsoft.com/favicon.ico?v2">
<link rel="stylesheet" href="../styles/docfx.vendor.css">
<link rel="stylesheet" href="../styles/docfx.css">
<link rel="stylesheet" href="../styles/main.css">
<link href="https://fonts.googleapis.com/css?family=Roboto" rel="stylesheet">
<meta property="docfx:navrel" content="../toc.html">
<meta property="docfx:tocrel" content="toc.html">

<meta property="docfx:rel" content="../">
<meta property="docfx:newtab" content="true">
</head> <body data-spy="scroll" data-target="#affix" data-offset="120">
<div id="wrapper">
<header>

<nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>

<a class="navbar-brand" href="../index.html">
<img id="logo" class="svg" src="../images/logo.svg" alt="">
</a>
</div>
<div class="collapse navbar-collapse" id="navbar">
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<label class="glyphicon glyphicon-search" for="search-query"></label>
<input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
</div>
</form>
</div>
</div>
</nav>
<div class="subnav navbar navbar-default">
<div class="container hide-when-search" id="breadcrumb">
<ul class="breadcrumb">
<li></li>
</ul>
</div>
</div>
</header>
<div class="container body-content">

<div id="search-results">
<div class="search-list">Search Results for <span></span></div>
<div class="sr-items">
<p><i class="glyphicon glyphicon-refresh index-loading"></i></p>
</div>
<ul id="pagination" data-first="First" data-prev="Previous" data-next="Next" data-last="Last"></ul>
</div>
</div>
<div role="main" class="container body-content hide-when-search">

<div class="sidenav hide-when-search">
<a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
<div class="sidetoggle collapse" id="sidetoggle">
<div id="sidetoc"></div>
</div>
</div>
<div class="article row grid-right">
<div class="col-md-10">
<article class="content wrap" id="_content" data-uid="">
<div class="pnp_tags">Available in the current Nightly Release only.</div>
<div class="contribution-panel mobile-hide pull-right">
<a href="https://github.com/pnp/powershell/blob/dev/documentation/#L1" title="Edit this page" class="improve-doc-lg"><i class="glyphicon glyphicon-pencil"></i></a>
</div>
<h1 id="convert-pnpfile">Convert-PnPFile</h1>

<h2 id="synopsis">SYNOPSIS</h2>
<p>Converts a file to another format</p>
<h2 id="syntax">SYNTAX</h2>
<h3 id="save-to-local-path">Save to local path</h3>
<pre><code class="lang-powershell">Convert-PnPFile -Url &lt;String&gt; -Path &lt;String&gt; [-Force]
</code></pre>
<h3 id="return-as-memorystream">Return as memorystream</h3>
<pre><code class="lang-powershell">Convert-PnPFile -Url &lt;String&gt; -AsMemoryStream
</code></pre>
<h3 id="save-to-sharepoint-online-same-sitecollection">Save to SharePoint Online (Same SiteCollection)</h3>
<pre><code class="lang-powershell">Convert-PnPFile -Url &lt;String&gt; -Folder &lt;String&gt;
</code></pre>
<h2 id="description">DESCRIPTION</h2>
<p>Allows converting of a file from SharePoint Online. The file contents can either be directly saved to local disk, or stored in memory for further processing, or Can be uploaded back to SharePoint Online SiteCollection</p>
<h2 id="examples">EXAMPLES</h2>
<h3 id="example-1">EXAMPLE 1</h3>
<pre><code class="lang-powershell">Convert-PnPFile -Url &quot;/sites/demo/Shared Documents/Document.docx&quot; -AsMemoryStream
</code></pre>
<p>Retrieves the file and converts to PDF, and outputs its content to the console as a Memory Stream</p>
<h3 id="example-2">EXAMPLE 2</h3>
<pre><code class="lang-powershell">Convert-PnPFile -Url &quot;/sites/demo/Shared Documents/Document.docx&quot;
</code></pre>
<p>Retrieves the file and converts to PDF, and outputs its content to the console as a Memory Stream</p>
<h3 id="example-3">EXAMPLE 3</h3>
<pre><code class="lang-powershell">Convert-PnPFile -Url &quot;/sites/demo/Shared Documents/Document.docx&quot; -Path &quot;C:\Temp&quot;
</code></pre>
<p>Retrieves the file and converts to PDF, and save it to the given local path</p>
<h3 id="example-4">EXAMPLE 4</h3>
<pre><code class="lang-powershell">Convert-PnPFile -Url &quot;/sites/demo/Shared Documents/Document.docx&quot; -Path &quot;C:\Temp&quot; -Force
</code></pre>
<p>Retrieves the file and converts to PDF, and save it to the given local path. Force parameter will override the existing file in the location where the document gets saved.</p>
<h3 id="example-5">EXAMPLE 5</h3>
<pre><code class="lang-powershell">Convert-PnPFile -Url &quot;/sites/demo/Shared Documents/Test/Book.xlsx&quot; -Folder &quot;/sites/demo/Shared Documents/Archive&quot;
</code></pre>
<p>Retrieves the file and converts to PDF, and save it to the given Document library (Folder) in SharePoint Online (same site collection)</p>
<h3 id="example-6">EXAMPLE 6</h3>
<pre><code class="lang-powershell">Convert-PnPFile -Url &quot;/sites/demo/Shared Documents/Test/Book.png&quot; -ConvertToFormat Jpg -Folder &quot;/sites/demo/Shared Documents/Archive&quot;
</code></pre>
<p>Retrieves the file and converts to JPG, and save it to the given Document library (Folder) in SharePoint Online (same site collection)</p>
<h2 id="parameters">PARAMETERS</h2>
<h3 id="-url">-Url</h3>
<p>The URL (server or site relative) to the file</p>
<pre><code class="lang-yaml">Type: String
Parameter Sets: (All)
Aliases: ServerRelativeUrl, SiteRelativeUrl

Required: True
Position: 0
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
</code></pre>
<h3 id="-converttoformat">-ConvertToFormat</h3>
<p>The format to which you want the file to be converted. Default is PDF.</p>
<p>The following values are valid transformation targets and their supported source extensions:</p>
<table>
<thead>
<tr>
<th style="text-align: left;">Target</th>
<th style="text-align: left;">Description</th>
<th>Supported source extensions</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align: left;">glb</td>
<td style="text-align: left;">Converts the item into GLB format</td>
<td>cool, fbx, obj, ply, stl, 3mf</td>
</tr>
<tr>
<td style="text-align: left;">html</td>
<td style="text-align: left;">Converts the item into HTML format</td>
<td>eml, md, msg</td>
</tr>
<tr>
<td style="text-align: left;">jpg</td>
<td style="text-align: left;">Converts the item into JPG format</td>
<td>3g2, 3gp, 3gp2, 3gpp, 3mf, ai, arw, asf, avi, bas, bash, bat, bmp, c, cbl, cmd, cool, cpp, cr2, crw, cs, css, csv, cur, dcm, dcm30, dic, dicm, dicom, dng, doc, docx, dwg, eml, epi, eps, epsf, epsi, epub, erf, fbx, fppx, gif, glb, h, hcp, heic, heif, htm, html, ico, icon, java, jfif, jpeg, jpg, js, json, key, log, m2ts, m4a, m4v, markdown, md, mef, mov, movie, mp3, mp4, mp4v, mrw, msg, mts, nef, nrw, numbers, obj, odp, odt, ogg, orf, pages, pano, pdf, pef, php, pict, pl, ply, png, pot, potm, potx, pps, ppsx, ppsxm, ppt, pptm, pptx, ps, ps1, psb, psd, py, raw, rb, rtf, rw1, rw2, sh, sketch, sql, sr2, stl, tif, tiff, ts, txt, vb, webm, wma, wmv, xaml, xbm, xcf, xd, xml, xpm, yaml, yml</td>
</tr>
<tr>
<td style="text-align: left;">pdf</td>
<td style="text-align: left;">Converts the item into PDF format</td>
<td>doc, docx, epub, eml, htm, html, md, msg, odp, ods, odt, pps, ppsx, ppt, pptx, rtf, tif, tiff, xls, xlsm, xlsx</td>
</tr>
</tbody>
</table>
<p>For more information, check <a href="https://pnp.github.io/pnpcore/using-the-sdk/files-intro.html#converting-files">this link</a>.</p>
<pre><code class="lang-yaml">Type: String
Parameter Sets: (All)

Required: False
Position: Named
Default value: Pdf
Accept pipeline input: False
Accept wildcard characters: False
</code></pre>
<h3 id="-asmemorystream">-AsMemoryStream</h3>
<pre><code class="lang-yaml">Type: SwitchParameter
Parameter Sets: Return as memorystream

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
</code></pre>
<h3 id="-path">-Path</h3>
<p>Local path where the file should be saved</p>
<pre><code class="lang-yaml">Type: String
Parameter Sets: Save to local path

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
</code></pre>
<h3 id="-force">-Force</h3>
<p>Overwrites the file if it exists.</p>
<pre><code class="lang-yaml">Type: SwitchParameter
Parameter Sets: Save to local path, Upload to SharePoint

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
</code></pre>
<h3 id="-folder">-Folder</h3>
<p>The destination library in the site</p>
<pre><code class="lang-yaml">Type: FolderPipeBind
Parameter Sets: (UPLOADTOSHAREPOINT)

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
</code></pre>
<h2 id="related-links">RELATED LINKS</h2>
<p><a href="https://aka.ms/m365pnp">Microsoft 365 Patterns and Practices</a></p>

</article>
</div>
<div class="hidden-sm col-md-2" role="complementary">
<div class="sideaffix">
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
</nav>
</div>
</div> </div>
</div>

<footer>
<div class="grad-bottom"></div>
<div class="footer">
<div class="container">
<span class="pull-right">
<a href="#top">Back to top</a>
</span>

<span>Generated by <strong>DocFX</strong></span>
<img src="https://m365-visitor-stats.azurewebsites.net/@pnp.github.io/index/" alt="spacer">
</div>
</div>
</footer>
</div>

<script type="text/javascript" src="../styles/docfx.vendor.js"></script>
<script type="text/javascript" src="../styles/docfx.js"></script>
<script type="text/javascript" src="../styles/main.js"></script>
<script type="text/javascript">
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "ag6usxufyq");
</script> </body>
</html>
Loading

0 comments on commit f9896dc

Please sign in to comment.